-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning about router in console #4
Comments
yeah, this is something I started to get as well. Will definitely investigate when I have time. |
+1 ... |
I was coming across this today too, it seemed to not like forceUpdate() within the RenderForcer class.
|
Based on this comment. I did modify the import React from 'react'
import ReactDOM from 'react-dom'
import { browserHistory } from 'react-router'
import { Router, Route } from 'react-router'
import Home from './routes/home'
import { IntlProvider, addLocaleData } from 'react-intl'
import en from 'react-intl/locale-data/en'
addLocaleData(en)
const routes = <Route path='/' component={Home}/>
class RenderForcer extends React.Component {
constructor () {
super()
}
componentWillMount () {
this.forceUpdate() // a little hack to help us rerender when this module is reloaded
}
render () {
return <IntlProvider locale='en'>
<Router history={browserHistory}>
{routes}
</Router>
</IntlProvider>
}
}
ReactDOM.render((
<RenderForcer/>
), document.getElementById('app')) Which made error (warning) goes away. Also it seems makes sense to separate routes. Either way, if this is something that considered as improvement I can open MR. |
@dmi3y I did it already, thanks so much! |
When I run this as-is in Chrome I get this in the console:
It seems to work anyway but would be nice to get rid of the warning.
The text was updated successfully, but these errors were encountered: