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
Following the Getting Started guide this snippet is presented for copy-pasting:
functionHome(){constrouter=useRouter()conststate=Route.useLoaderData()return(<buttontype="button"onClick={()=>{updateCount({data: 1}).then(()=>{router.invalidate()})}}>
Add 1 to {state}?
</button>)}
upon clicking the button, you are presented with "Add 1 to ?" in the UI. Refreshing the page presents the expected number.
Inspecting state shows that once the component rerenders, supposedly due to router.invalidate, it returns undefined.
Placing a console.log in the loader shows that its executed on page load and then never again, regardless of invalidation.
Your Example Website or App
None. The examples don't work, stackblitz won't let me fork the examples either.
Steps to Reproduce the Bug or Issue
follow the Getting Started guide to the end
fix the index.tsx not working because browsers remove trailing / for root routes making it unreachable since it's exact by changing it to something like home.tsx
click on Add 1 to ?
refresh the page
click on Add 1 to 1?
It becomes Add 1 to ?
Expected behavior
router.invalidate triggers another call to the route loader, and useRouteState does not return undefined
I've encountered multiple bugs immediately out of the gate without even starting to write any code of my own.
I know it's beta, but that was a bit rough even for beta imho..
The text was updated successfully, but these errors were encountered:
Which project does this relate to?
Start
Describe the bug
Following the Getting Started guide this snippet is presented for copy-pasting:
upon clicking the button, you are presented with "Add 1 to ?" in the UI. Refreshing the page presents the expected number.
Inspecting
state
shows that once the component rerenders, supposedly due torouter.invalidate
, it returnsundefined
.Placing a console.log in the
loader
shows that its executed on page load and then never again, regardless of invalidation.Your Example Website or App
None. The examples don't work, stackblitz won't let me fork the examples either.
Steps to Reproduce the Bug or Issue
index.tsx
not working because browsers remove trailing/
for root routes making it unreachable since it'sexact
by changing it to something likehome.tsx
Add 1 to ?
Add 1 to 1?
Add 1 to ?
Expected behavior
router.invalidate
triggers another call to the routeloader
, anduseRouteState
does not returnundefined
Screenshots or Videos
Platform
Additional context
I've encountered multiple bugs immediately out of the gate without even starting to write any code of my own.
I know it's beta, but that was a bit rough even for beta imho..
The text was updated successfully, but these errors were encountered: