React native router flux: TypeError: undefined is not a function (evaluating 'addListener')

帅比萌擦擦* 提交于 2019-12-03 20:13:31

So after doing some research and some tests i want to answer my question.

The problem was with the react-navigation dependency that handles internally react-native-router-flux

The dependencies are:

react-native-router-flux beta.0 - beta.24 -> react-navigation ^1.0.0-beta.19
react-native-router-flux beta.25 - beta.28 -> react-navigation 1.0.0-beta.22

the big difference here is that versions from 0 to beta24 uses ^

So .. what is the problem with that?

when installing the dependencies beta24 will search for the newest version of react-navigation since 1.0.0-beta.19, that version is the recent stable release 1.0.0 of react-navigation (the library is no more in beta version).

react-native-router-flux doesnt provide support for that dependency. It doesnt provide support to other olders dependencies neither, so they had just put the 1.0.0-beta22 react-navigation dependency fixed on their lastest releases package.json (since beta 26).

probably they will fix it since there are a lot of apps that use redux or other libraries that doesnt have good interaction with react-native-router-flux.

So for now.. the solution for Redux users is to go for the beta26 version, and for people that doesnt use redux probably beta27 and beta28 will be ok.

Here is the discussion: https://github.com/aksonov/react-native-router-flux/issues/2865

Here is another related issue: https://github.com/aksonov/react-native-router-flux/issues/2799

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!