I am trying to implement Meteor.startup with a Router React component (that lives in a different .jsx) however it doesn’t seem to work.
If I have the Router React component in the same .jsx file as Meteor.startup, then it works fine.
Any ideas why this might be?
Here is my code that doesn’t work :
import { Routes } from './routes.jsx';
Meteor.startup( () => {
render(<Routes />, document.body);
});
Please note that routes.jsx contains the same Route as the one shown in the code snippet below.
And here is the code that works :
export default class Routes extends Component{
render() {
return (
<Router history={browserHistory}>
<Route path="/" component={App}>
</Route>
</Router>
);
}
}
Meteor.startup( () => {
render(<Routes />, document.body);
});