@antivixen/react-show-case
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

React Show Case

JSX component to deal with conditional rendering in React Js. Inspired by SolidJS version

Usage

import { Show, Fallback } from "@antivixen/react-show-case";

export const Example = () => {
  const [isAvailable, setIsAvailable] = useState(false);
  return (
    <Show when={isAvailable}>
      <h1>Some content to show</h1>
      <Fallback>
        <h1>Some content to show if when statement is false</h1>
      </Fallback>
    </Show>
  );
};

It's worth noting that neither the Show nor the Feedback functions are compatible with primitive values. To make use of them, you can either employ a standard ternary operator or investigate this library

Package Sidebar

Install

npm i @antivixen/react-show-case

Weekly Downloads

1

Version

0.1.6

License

MIT

Unpacked Size

58.6 kB

Total Files

7

Last publish

Collaborators

  • antivixen