undefined is not an object (evaluating RNGestureHandlerModule.State)
up vote
0
down vote
favorite
I'm trying to create a stack navigator and it gives me the above mentioned error. My code as bellow
import React, {Component} from 'react';
import { createStore, applyMiddleware, compose } from 'redux';
import NavigationService from './Utils/NavigationService'
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
import Stat from './App/statsScreen'
import Sec from './App/loginScreen'
const RootStack = createStackNavigator(
{
Home: Stat,
Details: Sec
},
{
initialRouteName: "Details"
}
);
const AppNavigator = createSwitchNavigator(
{
App: RootStack,
}, {
initialRouteName: 'App'
}
);
export const store = (__DEV__) ? createStore(rootReducer, compose(applyMiddleware(thunk), window.devToolsExtension ? window.devToolsExtension() : f => f)) : createStore(rootReducer, applyMiddleware(thunk));
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<AppNavigator
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
</Provider>
);
}
}
However If I comment the "createStackNavigator" part and export a general class it works. What am I missing here? and with this code why is it trowing me an error like that ?
reactjs react-native react-navigation
add a comment |
up vote
0
down vote
favorite
I'm trying to create a stack navigator and it gives me the above mentioned error. My code as bellow
import React, {Component} from 'react';
import { createStore, applyMiddleware, compose } from 'redux';
import NavigationService from './Utils/NavigationService'
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
import Stat from './App/statsScreen'
import Sec from './App/loginScreen'
const RootStack = createStackNavigator(
{
Home: Stat,
Details: Sec
},
{
initialRouteName: "Details"
}
);
const AppNavigator = createSwitchNavigator(
{
App: RootStack,
}, {
initialRouteName: 'App'
}
);
export const store = (__DEV__) ? createStore(rootReducer, compose(applyMiddleware(thunk), window.devToolsExtension ? window.devToolsExtension() : f => f)) : createStore(rootReducer, applyMiddleware(thunk));
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<AppNavigator
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
</Provider>
);
}
}
However If I comment the "createStackNavigator" part and export a general class it works. What am I missing here? and with this code why is it trowing me an error like that ?
reactjs react-native react-navigation
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to create a stack navigator and it gives me the above mentioned error. My code as bellow
import React, {Component} from 'react';
import { createStore, applyMiddleware, compose } from 'redux';
import NavigationService from './Utils/NavigationService'
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
import Stat from './App/statsScreen'
import Sec from './App/loginScreen'
const RootStack = createStackNavigator(
{
Home: Stat,
Details: Sec
},
{
initialRouteName: "Details"
}
);
const AppNavigator = createSwitchNavigator(
{
App: RootStack,
}, {
initialRouteName: 'App'
}
);
export const store = (__DEV__) ? createStore(rootReducer, compose(applyMiddleware(thunk), window.devToolsExtension ? window.devToolsExtension() : f => f)) : createStore(rootReducer, applyMiddleware(thunk));
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<AppNavigator
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
</Provider>
);
}
}
However If I comment the "createStackNavigator" part and export a general class it works. What am I missing here? and with this code why is it trowing me an error like that ?
reactjs react-native react-navigation
I'm trying to create a stack navigator and it gives me the above mentioned error. My code as bellow
import React, {Component} from 'react';
import { createStore, applyMiddleware, compose } from 'redux';
import NavigationService from './Utils/NavigationService'
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
import Stat from './App/statsScreen'
import Sec from './App/loginScreen'
const RootStack = createStackNavigator(
{
Home: Stat,
Details: Sec
},
{
initialRouteName: "Details"
}
);
const AppNavigator = createSwitchNavigator(
{
App: RootStack,
}, {
initialRouteName: 'App'
}
);
export const store = (__DEV__) ? createStore(rootReducer, compose(applyMiddleware(thunk), window.devToolsExtension ? window.devToolsExtension() : f => f)) : createStore(rootReducer, applyMiddleware(thunk));
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<AppNavigator
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
</Provider>
);
}
}
However If I comment the "createStackNavigator" part and export a general class it works. What am I missing here? and with this code why is it trowing me an error like that ?
reactjs react-native react-navigation
reactjs react-native react-navigation
edited 2 days ago
Hardik
1
1
asked 2 days ago
danu
232318
232318
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373123%2fundefined-is-not-an-object-evaluating-rngesturehandlermodule-state%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown