react-toggle-display
A stateless react component that toggles the display of it's children. It's like ng-show
, ng-hide
or ng-if
but for react.
This allows you to DRY up statements like this:
Example usage:
Props
hide
- boolean
show
- boolean
if
- boolean
tag
- string. The tag name to use as the ToggleDisplay element. Defaults to span.
The two first props are simply the inverse of each other. Using both at the same time will result in canceling each other out.
Install
npm install react-toggle-display
Tests
To run tests: npm test