1

I have a screen in react native for android.

I wanted to do some operation when particular screen(implemented in react-native) alone resumes as like fragment's onresume() in java/kotlin

How shall i achieve the fragment's onResume() concept in react native screen?

Searched and analysed some question in stack overflow. I see examples for APP state change but not the screen's state changes in react native.

Thanks in advance!

Happy
  • 1,031
  • 10
  • 26

1 Answers1

0

In case you are using react-navigation you might use useFocusEffect -> https://reactnavigation.org/docs/use-focus-effect/

Michael Bahl
  • 2,941
  • 1
  • 13
  • 16
  • 1
    Thanks Michael!, But i tried the useFocusEffect. but didnt get callback when specific screen comes to foreground from background. – Happy Feb 03 '22 at 06:46