help with react native (react-navigation)


#1

I am trying to reopen screen using “react-navigation”, but constructor and componentDidMount methods didn’t fired.

how to fire these methods after reopen screens?

thanks,


#2

It seems that you use react navigation 2.0, there’re some problems, heh :slight_smile:

You should use navigation.push instead of navigation.navigate


#3

Hey @infographapps,

I’m not entirely sure what you are asking, but my preliminary thought is that you are hoping to execute some code after going back to a screen that hasn’t been unmounted.

You can achieve that by using a focus listener that will execute the code when the screen is focused again: https://reactnavigation.org/docs/en/navigation-prop.html#addlistener-subscribe-to-updates-to-navigation-lifecycle

Cheers,

Adam


#4

thanks @methos2018 , works with navigation.push


#5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.