-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Can't read property 'router' of null #2049
Comments
You must have container scene as root. Otherwise this component doesn't make any sense. |
Can you explain what you mean by this, 'container scene as root'? I am getting the same error. Thanks |
Ok, I'm not getting the error any more, but it only shows a blank screen on my Android simulator. Here is the relevant code: import React, { Component } from 'react'; render() {
} **** Only showing render method, because if I take out components and replace with just LoginForm component, it will render correctly. |
Your root scene is not container
… 1 авг. 2017 г., в 18:56, ranasing ***@***.***> написал(а):
Ok, I'm not getting the error any more, but it only shows a blank screen on my Android simulator. Here is the relevant code:
import React, { Component } from 'react';
import { Scene, Router } from 'react-native-router-flux';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import LoginForm from './components/LoginForm';
render() {
const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));
return (
<Provider store={store}>
<Router>
<Scene key='login' component={LoginForm} title='Login' />
</Router>
</Provider>
);
}
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@ranasing you should check the documentation, you need to nest all you scenes in the root scene as in the example:
|
@TeslaMotors91 came here after that course as well. This does it. He doesn't use the "root" thing. Hence the issue. |
@alfchee thanks for the help...
|
@aksonov the guy asked a question and did not get a commensurate response. If you take the time to answer a question, do it fully please. |
@alfchee This is really helpful! |
@TeslaMotors91 @SarasArya In the Stephen Grider course, he is using a different version of this library. |
Sthepen Grider use 3.35.0 version, but i choose to use last version and got same error like this issue.. |
"react": "16.0.0-alpha.12",
"react-native": "0.46.1",
"react-native-router-flux": "^4.0.0-beta.11",
<Router> <Scene key='login' component={LoginForm} title='Login' /> </Router>
when i run my code,give me following error message:
'Can't read property 'router' of null'
in Router.js 279:46
The text was updated successfully, but these errors were encountered: