Replies: 4 comments 5 replies
-
you can do it in the parent route component instead of the root component. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for getting back! That‘s true as long as you have only one outlet on the page where you want to apply this. I was experimenting with e.g. dialogs where the dialog lives in a nested route. When doing this, it would be preferable to only render a spinner within the dialog while the dialog is pending - however, I couldn‘t find a way to find out if the current useNavigatipn is the „most deep“ one in the tree. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
Hey @v-morlock, did you find an answer to this behavior? I just came up with the same scenario, I'm thinking of either changing the fallback from replacing the Outlet to just load in top of it so it doesn't feel weird, or see if I can detect the state where the child Layout is loaded first time so I won't let the parent Layout show a loading screen. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem currently. For example if I have a /users route that displays users list in a sidebar. once I click on a user list item I trigger navigation to a /users/{userId} route that should display user overview that has a link to user posts route /users/{userId}/posts. then I can navigate to a particular post /users/{userId}/posts/{postId} that shows the post content and comments. If I use useNavigation() and navigation.state === "loading" on each of the routes I only see the Spinner on the /users route and not on the userId or posts or postId routes. Instead of a Spinner for the postId for example. Await and Suspense is not an option for me as I resolve the data fetching in the router and use Either pattern to return a Success(with data) or an Error(with message) from the loader. I also have a list of the latest posts in the Users sidebar and if I select to navigate to a postId route my whole screen just freezes and waits for all the loaders to load their data and then render all the routes (they are on the same page). I tried searching for the solutions but couldn't find anything. Claude also hallucinating trying to provide the solution and just goes in circle providing non working slop lol. Anyone who has solved this problem already? I cannot be the only one who has this issue :( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm enjoying remix a lot - one question regarding nested loading states.
When remix is doing client side transitions, and route loaders are slow, remix feels kinda unresponsive to me as the user has no indication that a load is taking place in the background. I've been experimenting with hiding the page content once loading takes place and showing a spinner by using "useNavigation" in the root component, but one problem i've encountered is that this also hides the full page if only a small nested part of the page (using nested routes/outlet) is loading.
I'd actually be looking for an api like "Suspense" where I can show a fallback UI for only the nested route that's in a client-side transition right now. Basically think of wrapping each "outlet" in a suspense - i couldn't find a way to extract this information from the data given by "useNavigation".
Is there any recommended way for doing this in remix? Or do you have other suggestions on good methods to counter this unresponsive feeling remix gives in such cases?
Beta Was this translation helpful? Give feedback.
All reactions