ᴙᴃ
Submit a library
Examples
Needed Examples
Links
/d
directiv.es
∞
JavascriptOO
FillText.com
LearnYou.It
react-router-component
Declarative router component for React
Website:http://andreypopp.viewdocs.io/react-router-component
Demo
ReadMe
Stats
Author
Download
CDN
#Routing
You can edit this code
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>React Router Component example</title> </head> <body> <div id="main"></div> <script src="http://fb.me/JSXTransformer-0.10.0.js"></script> <script src="/application/html/js/andreypopp/react-router-component/bundle.js"></script> <script type="text/jsx"> /** @jsx React.DOM */ var Main = React.createClass({ render:function(){ return ( <div> <h2>This is the Main Component</h2> <Links /> </div> ) } }); var Item = React.createClass({ render:function(){ return ( <div> <h2>This is the Item page for item: {this.props.item}</h2> <Links /> </div> ) } }); var Links = React.createClass({ render:function(){ var items = [‘one’, ‘two’, ‘three’].map(function(item, i){ return <li key={i}><Link globalHash={true} href={‘/’ + item}>Item {item}</Link></li> }) return <ul>{items}</ul> } }); var APP = React.createClass({ render: function() { return ( <div> <h1>Master-detail with react-router-component</h1> <Locations hash> <Location path="/" handler={Main} /> <Location path="/:item" handler={Item} /> </Locations> </div> ); } }); React.renderComponent(<APP />,document.getElementById(‘main’)) </script> </body>
×
CDN