https://github.com/dashed/react-either
Higher-order component to conditionally render either a component or an alternative component
https://github.com/dashed/react-either
Last synced: 7 months ago
JSON representation
Higher-order component to conditionally render either a component or an alternative component
- Host: GitHub
- URL: https://github.com/dashed/react-either
- Owner: dashed
- License: mit
- Created: 2015-05-26T20:33:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-26T21:10:10.000Z (over 10 years ago)
- Last Synced: 2025-06-09T17:24:48.050Z (8 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-either
> Higher-order component to conditionally render a component or an alternative component
## Usage
```
$ npm install --save react-either
```
```js
const either = require('react-either');
either(Component, AltComponent, function(props) {
// ...
// return true to render Component; otherwise render AltComponent
return cond;
});
```
## License
MIT