Closed Lenny4 closed 2 years ago
Hi @Lenny4,
Thank you for contributing.
Your solution is not good and does not resolve the problem with access to the actual redux state from a listener. Since the listener is a closure it has access only to the component values from the first render. Each subsequent render has no effect on already defined listeners.
Here you have a similar situation with setInterval
: https://stackoverflow.com/questions/53024496/state-not-updating-when-using-react-state-hook-within-setinterval
If you use Redux you can get the actual value directly from the store instance. Look at my example on Expo Snack: https://snack.expo.dev/@quiknull/react-native-sse-redux-example
Feel free to update docs with this solution.
@wojciechkrol is it better now ?
Hi @wojciechkrol , i'm still waiting for an answer
Hi @Lenny4. Thank you for the update.
Thank you!
@wojciechkrol done !
@binaryminds please tell me if my explanation is clear.