As they point out in the docs, they've gotten rid of the 4 navigation event listeners and instead decided to use Lifecycle events.
But the problem I'm running into with React Navigation 5 is that the blur
event doesn't work as I need it to! Before, I could add an onWillBlur
listener, and do stuff when the user temporarily leaves (not closes) the app (such as close a socket connection, and then reopen it when the user reenters the app).
How can I replicate the onWillBlur
or onDidBlur
events for such a use case? I don't need to know if Screen A is blurred after the user is taken to Screen B after clicking a button.