1.0.1 • Published 2 years ago

@jfdi/react-utils-show v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Show

Show is what conditionals should always have been in React.

Install

npm install --save @jfdi/react-utils-show

Example

import React, { useState } from "react";
import ReactDOM from "react-dom";
import { Show } from "@jfdi/react-utils-show";

const App = () => {
    const [enabled, setEnabled] = useState(false);
    return (
        <Show when={enabled}>
            {"Passed the if check"}
        </Show>
    );
};
ReactDOM.render(<App />, document.getElementById("root"));