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"));