aksonov / react-native-router-flux

The first declarative React Native router
MIT License
8.98k stars 2.11k forks source link

TypeError: navigationStore.getStateForAction is not a function. (In 'navigationStore.getStateForAction(action, state)', 'navigationStore.getStateForAction' is null) #3716

Open Sohailbhutto opened 4 years ago

Sohailbhutto commented 4 years ago

Passing default navigator reducer cause the error. Project is working fine on react-native v0.58.6, but for some reason i have to update it to latest version. And is starts crashing. (I have created new project and copied configure store logic from previous project)

import {Reducer, ActionConst} from 'react-native-router-flux'; const defaultReducer = Reducer(); export default (state, action) => { switch (action.type) { case ActionConst.FOCUS: return defaultReducer(state, action); default: return defaultReducer(state, action); } };

grantgarland commented 3 years ago

bump

ahsan-viabletree commented 3 years ago

Screenshot_1616442117

`// @flow import React, {Component} from 'react'; import {Provider} from 'react-redux'; import {AppRegistry, View} from 'react-native'; import {MessageBar} from './components'; import configureStore from './store'; import AppNavigator from './navigator'; import applyConfigSettings from './config'; import AppStyles from './theme/AppStyles';

const reducers = require('./reducers').default;

applyConfigSettings();

export default class App extends Component { state = { isLoading: true, store: configureStore(reducers, () => { this._loadingCompleted(); this.setState({isLoading: false}); }), };

_loadingCompleted() { // DataHandler.setStore(this.state.store); }

componentDidMount() {}

render() { if (this.state.isLoading) { return null; }

return (
  <View style={AppStyles.flex}>
    <Provider store={this.state.store}>
      <AppNavigator />
    </Provider>
    <MessageBar />
  </View>
);

} }

AppRegistry.registerComponent('AutoConnect', () => App); `

pakage.json

{ "name": "Belleza", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-community/async-storage": "^1.12.0", "@react-native-community/masked-view": "^0.1.10", "@react-native-community/viewpager": "^4.1.6", "@react-native-picker/picker": "^1.9.8", "apisauce": "^1.0.2", "lodash": "^4.17.11", "moment": "^2.24.0", "prop-types": "^15.7.2", "react": "17.0.1", "react-native": "0.64.0", "react-native-bottomsheet": "^2.2.0", "react-native-calendar-strip": "^2.1.0", "react-native-confirmation-code-input": "^1.0.4", "react-native-gesture-handler": "^1.7.0", "react-native-image-crop-picker": "^0.35.2", "react-native-image-zoom-viewer": "^3.0.1", "react-native-iphone-x-helper": "^1.2.0", "react-native-keyboard-aware-scroll-view": "^0.9.3", "react-native-linear-gradient": "^2.5.6", "react-native-localization": "^2.1.6", "react-native-message-bar": "^2.0.10", "react-native-modal": "^9.0.0", "react-native-phone-number-input": "^1.2.0", "react-native-raw-bottom-sheet": "^2.2.0", "react-native-reanimated": "^1.13.0", "react-native-router-flux": "^4.3.0", "react-native-safe-area-context": "^3.2.0", "react-native-screens": "^2.10.1", "react-native-simple-radio-button": "^2.7.4", "react-native-skeleton-placeholder": "^3.0.2", "react-native-snackbar": "^2.2.3", "react-native-snap-carousel": "^3.9.1", "react-native-swiper": "^1.6.0", "react-redux": "^7.0.2", "redux": "^4.0.1", "redux-logger": "^3.0.6", "redux-saga": "^1.0.2", "redux-storage": "^4.1.2", "redux-storage-decorator-filter": "^1.1.8", "redux-storage-engine-reactnativeasyncstorage": "^1.0.5", "remote-redux-devtools": "^0.5.16", "seamless-immutable": "^7.1.4" }, "devDependencies": { "@babel/core": "^7.13.10", "@babel/runtime": "^7.13.10", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "^7.22.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.65.2", "react-test-renderer": "17.0.1" }, "jest": { "preset": "react-native" } }

ahsan-viabletree commented 3 years ago

any update?