jedwards1211 / meteor-webpack-react

(DEPRECATED) use jedwards1211/crater instead
https://github.com/jedwards1211/crater
374 stars 75 forks source link

React router #115

Closed tomitrescak closed 8 years ago

tomitrescak commented 8 years ago

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:

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>
tomitrescak commented 8 years ago

Nevermind .. I'm an idiot. It all works well with above config.