Open ludiaz opened 6 years ago
@ludiaz I also need support for same implementation as mentioned by you. Is there any solution so far? Appreciate any help!!!
@ludiaz that's a react navigator problem since you cannot use "this"
@daveteu if one cannot use 'this' what is the solution. any help would be appreciated
if i understood your problem correctly,
you can add a state changing function in your parent / main component and then pass it as a prop to the child. react re-renders when state changes...
read this https://stackoverflow.com/questions/35537229/how-to-update-parents-state-in-react
App.js
router.js
Menu.js
The code works fine. But, the principal question now is:
How i change the screen when i click in menu item. On App.js, the code "onMenuItemSelected" receive the item parameter correctly. but, i try to use something like "const { navigate } = this.props.navigation;" at constructor (App.js) but, raise a excepction.
I would be very happy if someone help-me!