Closed apatrida closed 3 weeks ago
Tested again with 1.0.1 and router 0.13.4, no change.
Tested again on 1.0.1 and router 0.13.5, no change.
This happens both when first loading a page and also when navigating to it from another route.
It appears that it's caused by the createRenderEffect
that handles browser back/forward (native) navigations firing too eagerly, wiping out the submissions array when it shouldn't since native navigations aren't being performed.
Am working on a fix.
Thanks. Looks to be fixed 0.13.6. I didn't realize it because I botched the 0.13.3 release.. but there was a PR in there #405 that broke a bunch of stuff unintentionally and I believe are back to a good place now.
Describe the bug
Calling an action (useAction) in onMount is destroyed by a post-hydration process and break their ability to receive values or trap exceptions.
https://discord.com/channels/722131463138705510/910635844119982080/1245271486881857638
and the reproducible case linked: https://stackblitz.com/edit/github-hzq3du-fznnvu?file=src%2Fcomponents%2FHomeRoute.tsx
(note that it can work the first run or after HMR, so use refresh to see the fail)
This case fails (see console logs). Work arounds:
both might be fragile as not sure timing is deterministic.
Specific cause mentioned in discord: https://discord.com/channels/722131463138705510/910635844119982080/1245278570104754228
Your Example Website or App
https://stackblitz.com/edit/github-hzq3du-fznnvu?file=src%2Fcomponents%2FHomeRoute.tsx
Steps to Reproduce the Bug or Issue
useAction
anduseSubmission
note the logs and display are incorrect, actions goes to undefined.
Expected behavior
The action works as normal. Values and errors come back to the tracked submission.
Screenshots or Videos
No response
Platform
All day long, everywhere
Additional context
No response