react-render-conditions

0.0.1 • Public • Published

React Conditional Rendering

This is a React library for conditional rendering.

Installation

Use the package manager npm to install react-render-conditions.

npm install react-render-conditions

Usage

import { Switch, Case, Default } from 'react-render-conditions';

function MyComponent() {
  return (
    <Switch>
      <Case condition={true}>This will render</Case>
      <Case condition={false}>This will not render</Case>
      <Default>This will render if none of the Cases render</Default>
    </Switch>
  );
}

Running Tests

To run tests, use the following command:

npm test

Author

Shashikant S. Wagh shashikantwagh721@gmail.com

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i react-render-conditions

Weekly Downloads

4

Version

0.0.1

License

MIT

Unpacked Size

5.28 kB

Total Files

6

Last publish

Collaborators

  • shashikant_wagh