0.2.0 • Published 5 years ago
react-view-switch v0.2.0
react-view-switch
Minimalistic switch component for React. It renders one child view component at a time. It can be used as building block for routers, steppers, tabs etc.
Installation
npm install react-view-switch --save
Usage
For use with es6 modules
import React from 'react';
import render from 'react-dom';
import { Switch, View } from 'react-view-switch';
render((
<Switch current="first-view"}>
<View name="first-view">
<Component/>
</View>
<View name="second-view">
<Component/>
</View>
</Switch>
),
'your-root-element'
);
Examples
For examples just run npm script
npm run examples
and go to http://localhost:8008
License
MIT, see LICENSE.md for details.