Я пытаюсь реализовать редукцию и навигацию в собственном приложении реакции, поэтому я пытаюсь следовать инструкциям для реактивных помощников реагирования ( здесь ).
Однако при попытке запустить приложение я получаю следующую ошибку:
App.js:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { Provider, connect } from 'react-redux';
import rootReducer from './src/reducers/index';
import { createStackNavigator, createAppContainer } from 'react-navigation';
import { reduxifyNavigator, createReactNavigationReduxMiddleware, createNavigationReducer } from 'react-navigation-redux-helpers';
import LoginScreen from './src/screens/LoginScreen';
import NotesScreen from './src/screens/NotesScreen';
const AppNavigator = createStackNavigator({
Login: {
screen: LoginScreen
},
Notes: {
screen: NotesScreen
}
})
const navReducer = createNavigationReducer(AppNavigator);
const appReducer = combineReducers({
rootReducer,
navReducer
})
const middleware = createReactNavigationReduxMiddleware('Login', state => state.nav);
const App = reduxifyNavigator(AppNavigator, 'Login');
const mapStateToProps = state => ({
state: state.nav
})
const AppWithNavigationState = connect(mapStateToProps)(App);
const store = createStore(appReducer, applyMiddleware(middleware));
export default class Root extends React.Component {
render() {
return (
<Provider store={store}>
<AppWithNavigationState />
</Provider>
)
}
}