Closed tomitrescak closed 8 years ago
Anyone tried to work with react router? I have added it npm install history react-router@next
npm install history react-router@next
And it correctly renders the root route, but it is refusing to render any of the child routes. Anyone bumped into this?
Here is my route config:
import React from 'react'; var r = React.render; import ReactDOM from 'react-dom'; import { Router, Route, Link } from 'react-router'; import createBrowserHistory from 'history/lib/createBrowserHistory' import App, { About, Inbox } from "./app"; ReactDOM.render(( <Router history={createBrowserHistory()}> <Route path="/" component={App}> <Route path="about" component={About} /> <Route path="inbox" component={Inbox} /> </Route> </Router> ), document.getElementById('root'))
This is render of the app
<div> <h1>App</h1> <ul> <li><Link to="/about">About</Link></li> <li><Link to="/inbox">Inbox</Link></li> </ul> {this.props.children} </div>
Nevermind .. I'm an idiot. It all works well with above config.
Anyone tried to work with react router? I have added it
npm install history react-router@next
And it correctly renders the root route, but it is refusing to render any of the child routes. Anyone bumped into this?
Here is my route config:
This is render of the app