this.props.navigation.addListener is not a function
kaiyes opened this issue · 3 comments
kaiyes commented
kaiyes commented
"react-native": "0.47.1",
not using expo. Package installed fine using yarn add satya164/react-navigation-addons
. Importing enhance properly as well. Using this.props.navigations.addListener('focus', _this.handleWhatever)
causes this red screen of error. 🗡 🈂️ 🉑
elliottjro commented
@kaiyes this means you didnt wrap your stack/tab navigators in enhance()
kaiyes commented
@elliottjro thanks. Solved this issue by abandoning this approach and using a hack. passing a new Date() object in componentWillReceieveProps
makes the component re render everytime it is rendered. Hope react navigation solves this issue soon. Until that time, this hack will do. See #51 in react navigation issues