You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at first I would like to say thanks for this great library. I was searching for a replacement of ngrx effect in my react application after transition from angular to react stack, but I also found a weird issue when used with FC component.
I didnt have time to analyze it more, so more details will come as soon as possible, but maybe you will have more ideas about a workaround.
When I use useReducerWithSideEffects inside the FC component which stays as a Context provider, and call an async method from the child component available from the context state, every reduce action will cause re-rendering the provider component, which, probably, re-creates useReducerWithSideEffects which will cause for the same action being dispatched again.
I will add a sandbox example, but maybe you also came into the same issue previously when writing this library.
Thanks,
L.
Update 1: I've checked your code which mentions the issue when StrictMode is used, but it's not this issue. Same issue occurs when StrictMode is not used. I also tried to use memoized callback for reduce and effect when creating side effect reducer, but this did not help either.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Hi @Jibbedi,
at first I would like to say thanks for this great library. I was searching for a replacement of ngrx effect in my react application after transition from angular to react stack, but I also found a weird issue when used with FC component.
I didnt have time to analyze it more, so more details will come as soon as possible, but maybe you will have more ideas about a workaround.
When I use
useReducerWithSideEffects
inside the FC component which stays as a Context provider, and call an async method from the child component available from the context state, every reduce action will cause re-rendering the provider component, which, probably, re-createsuseReducerWithSideEffects
which will cause for the same action being dispatched again.I will add a sandbox example, but maybe you also came into the same issue previously when writing this library.
Thanks,
L.
Update 1: I've checked your code which mentions the issue when StrictMode is used, but it's not this issue. Same issue occurs when StrictMode is not used. I also tried to use memoized callback for reduce and effect when creating side effect reducer, but this did not help either.
The text was updated successfully, but these errors were encountered: