React-native-router-flux: Error on ios platform

Created on 26 Sep 2018  ·  10Comments  ·  Source: aksonov/react-native-router-flux

Version

  • react-native-router-flux v4.0.3
  • react v16.4.2
  • react-native v0.55.4

Expected behaviour

Actual behaviour

image

Steps to reproduce

Reproducible Demo

All 10 comments

I have the same error when upgrading from 4.0.1 to 4.0.2/4.0.3

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

This error is located at:
    in NavigationContainer (at Router.js:97)
    in App (at Router.js:122)

package.json

"react": "16.5.2",
"react-native": "0.57.1",
"react-native-router-flux": "^4.0.3",

Version 4.0.1 is work fine.

Probably you have custom reducer, so you need now to pass Actions to createReducer method.
Please check Example project for more details.

26 сент. 2018 г., в 12:58, dalba1992 notifications@github.com написал(а):

Version

Tell us which versions you are using:

react-native-router-flux v4.0.3
react v16.4.2
react-native v0.55.4
Expected behaviour

Actual behaviour

https://user-images.githubusercontent.com/20521231/46075763-10868b00-c1be-11e8-9ddd-ea1e0072c0fb.png
Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
1.
2.
3.

Reproducible Demo

Please provide a minimized reproducible demonstration of the problem you're reporting.

Issues that come with minimal repro's are resolved much more quickly than issues where a maintainer has to reproduce themselves.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/aksonov/react-native-router-flux/issues/3294, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQpccmLTbSqhHmG2MJotVCO5RBcUfLQks5ue13ggaJpZM4W6Z6Y.

It was working well on android, but it is not working on only ios

Please check examples/react-native - it works for iOS

If your app breaks after upgrading to > 4.0.2, you should maybe re-consider your router declaration when app starts, as done here in the example

There was a change in the createReducer API like you can see in the image below.

screenshot 2018-09-26 18 15 00

PR #3295 shows the change in the expo example.

My apologies for breaking change. I mistakenly thought that createReducer is not used by community ;)
4.0.4 should fix it - old API is preserved

@aksonov still getting this error when running examples/react-native on ios with 4.0.6

@aksonov me too, still getting this error when running examples/react-native on ios with V4.0.6

here is a quick fix, downgrade react-native-router-flux to react-native-router-flux": "4.0.0-beta.27" and run these commands

watchman watch-del-all
yarn cache clean --force
npm cache clean --force # optional - in case you also have used npm
rm -rf node_modules/
rm yarn.lock
rm package-lock.json # optional - in case you also have used npm
rm -rf $TMPDIR/metro-*
rm -rf $TMPDIR/haste-*
yarn
yarn start --reset-cache

reference:
https://github.com/aksonov/react-native-router-flux/issues/3023

Was this page helpful?
0 / 5 - 0 ratings