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
Thanks for reporting! This sure looks like a bug with watchFn. I tried replacing it with watch, which works as expected. So if you can make do withwatch (i.e. you have a primitive to watch on), you can use that as a workaround.
Do you want to take a stab at fixing this and open a PR? That would be greatly appreciated.
Potentially related #4
Issue
When watching for a variable change using
watchFn
, the react async hook properly re-runspromiseFn
but with old props passed in.Expected
promiseFn
should have received the new props on re-run.Example
See https://codesandbox.io/s/jovial-grothendieck-3xth2
In the example above the first render console.logs the following:
All is good! But once we change the fruit, we get the following:
And if we run it again:
Am I missing something with the way hooks work or overlooking something simple? Any help will be appreciated!
The text was updated successfully, but these errors were encountered: