I’m not sure what is going on either. Feels weird.
Here is a project I’m working on (it’s just a testing area)
And I use the following (successfully)
import { Meteor } from 'meteor/meteor'
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, IndexRoute, browserHistory } from 'react-router'
import { Accounts, STATES } from 'meteor/std:accounts-ui';
import App from '../../ui/pages/app'
import MyEditor from '../../ui/layouts/editor'
import LogIn from '../../ui/layouts/login'
class Home extends Component {
render () {
return (
<div>
<MyEditor />
<LogIn />
</div>
)
}
}
const routes = (
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home} />
<Route path="/signin" component={() => <Accounts.ui.LoginForm />} />
<Route path="/signup" component={() => <Accounts.ui.LoginForm formState={STATES.SIGN_UP} />} />
</Route>
</Router>
)
Meteor.startup(() => {
ReactDOM.render(routes, document.querySelector('.draft-js-meteor-container'))
})
Feel free to clone the project and test it out in your environment.
git clone git@github.com:JeremyIglehart/DraftJSMeteor.git
From what I see, your code should work.
my project is using:
"babel-runtime": "6.18.0",
"bcrypt": "^1.0.2",
"draft-js": "^0.9.1",
"material-ui": "^0.16.7",
"meteor-node-stubs": "~0.2.0",
"react": "^15.4.2",
"react-addons-pure-render-mixin": "^15.4.2",
"react-dom": "^15.4.2",
"react-router": "^3.0.2",
"react-tap-event-plugin": "^2.0.1"
I’m not sure what you’re using “history” for - you’re not even importing from it in your project?
The only thing that is weird to me is defining your routes not as a constant. Also, the fact that you’re defining them inside the meteor startup is “weird” to me, because it’s not my coding style, but it doesn’t look like it should matter. But, maybe give my pattern a try and see if it changes things?