@jfdi/react-utils-show
v1.0.1
Published
Show is what conditionals should always have been in React.
Downloads
1
Keywords
Readme
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"));