react-mrouter
v0.0.2
Published
React Interactions, Render Once Use Anywhere
Downloads
14
Maintainers
Readme
react-mrouter
React Router for Mobile SPA
Live demo
https://broltes.github.io/router
Usage
npm install --save react-mrouter
import { Router } from 'react-mrouter';
var Views = {
base: require('./views/base'),
view1: require('./views/1'),
view2: require('./views/2'),
};
var App = React.createClass({
render: function(){
return <Router Views={Views}/>;
}
});
render(<App/>, document.getElementById('app'));
pass actions through href
to target view props
<a href="#/view1/action1/action2">pass actions to view1</a>
pass params through router.goto()
to target view props
import router from 'react-mrouter';
function gotoView2WithParams(){
router.goto('/view2', 'some params');
}
<a onClick="gotoView2WithParams">pass params to view2</a>