Reputation: 96
I have ComponentOne which is a Parent of ComponentTwo. Then i have ComponentThree and ComponentFour. Question is i can easily Navigate between ComponetOne to ComponentThree and ComponentFour, BUT i am unable to navigate from a button in ComponentTwo which is a child of ComponentOne, i am using Stack Navigation in React Native, error: evaluating ( this.props.navigator ) Undefined is not an object
I have tried declaring const {navigator} at various places in ComponentTwo but nothing seems to work at help Help will be highly appreciated. :)
Upvotes: 1
Views: 132
Reputation: 96
I had a luck, Just passed the as a props to ComponetTwo and it works now :) I think we need to pass the navigation reference as a prop to child Component to access it from child component. Thanks,
Upvotes: 2