satya164/react-navigation-addons

this.props.navigation.addListener is not a function

kaiyes opened this issue · 3 comments

"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. 🗡 🈂️ 🉑

@kaiyes this means you didnt wrap your stack/tab navigators in enhance()

@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