#Why is whole app unmounted on navigation?

7 messages · Page 1 of 1 (latest)

dense mesa
#

Please take a look at this: https://codesandbox.io/s/solid-app-router-nested-routes-forked-8pfpfh?file=/index.js

  1. Navigate to /login
  2. Click on login button

For some reason it unmounts the whole app for a second while it's transitioning.

Isn't it supposed to hold the previous state until / resources are loaded and it's rendered?
I mean that's how it works if you navigate between / and /posts.

It looks like initiating new createResource while transition is ongoing, breaks the transition.
Any suggestions why it happens (what's the rule around this) and/or how to overcome it?

dense mesa
#

Why does the first navigation unmount the whole app?

#

Why is whole app unmounted on navigation?

dense mesa
#

I feel like there's a unwritten rule of "only use 1 resource per suspended route" somewhere but would really love to get details from someone who knows this stuff.

woven cobalt
#

this is what you should expect when using suspense, the suspense fallback (so in this case nothing) is shown while suspended

#

to avoid that you should use startTransition or useTransition