0
votes

enter image description here

TypeError: Cannot read property ‘navigation’ of undefined? Looks like my component has no access to this.props.navigation.( react-navigation) Basically I get this error whenever I call: const { navigate } = this.props.navigation.

Any idea how to give the component access to this.props.navigation ?

1

1 Answers

1
votes

ES6 classes don't autobind this. There's a few solutions to this like binding in the constructor or just changing it to an arrow function:

renderRow = ({ item }) => {
  // rest of code
}