Allow conditional matching in React JSX.
npm install react-jsx-matchAllow conditional matching in React JSX.
``sh
npm i react-jsx-match
or
yarn add react-jsx-match
`
`tsx
import { Case, Else, Falsy, Match, Truthy, Render } from "react-jsx-match";
function Example() {
const variable: number = 100; // variable can be any
return (
<>
{/ Match exact values /}
{/ loose means == /}
One
{/ val can be a callback /}
{/ Match truthy values /}
{/ Match falsy values /}
{/ If nothing above matches... /}
{/ Render children only if when condition is truthy /}
>
);
}
`
`sh``
npm i
npm run build
npm run test
npm run coverage