-
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 #2158
Comments
I think container scene as root means that you should have a Scene-component directly under Router-component with render() {
const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));
return (
<Provider store={store}>
<Router>
<Scene key='root'>
<Scene key='login' component={LoginForm} title='Login' initial />
</Scene>
</Router>
</Provider>
);
} |
Ok thank you! I’ll give that a try.
From: mikaello [mailto:[email protected]]
Sent: Tuesday, August 01, 2017 1:38 PM
To: aksonov/react-native-router-flux
Cc: ranasing; Author
Subject: Re: [aksonov/react-native-router-flux] Can't read property 'router' of null #2049 (#2158)
I think container scene as root means that you should have a Scene-component directly under Router-component with key='root that encapsulates all your other scenes:
render() {
const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));
return (
<Provider store={store}>
<Router>
<Scene key='root'>
<Scene key='login' component={LoginForm} title='Login' initial />
</Scene>
</Router>
</Provider>
);
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2158 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AV_K-IU62DU1fKoJ0Q5s48sOy8tqun6Bks5sT2KUgaJpZM4OqBm_>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, I reposted this because realized that original post was closed.
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 (update:, it gave me a blank screen, but then went back to the old error above reappeared) :
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>
);
}
**** Only showing render method, because if I take out components and replace with just LoginForm component, it will render correctly.
The text was updated successfully, but these errors were encountered: