0.0.1 • Published 2 years ago
react-render-conditions v0.0.1
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-conditionsUsage
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 testAuthor
Shashikant S. Wagh shashikantwagh721@gmail.comLicense
This project is licensed under the MIT License.0.0.1
2 years ago