Deferred routes support #3910
-
Good day! I'm having a trouble trying to figure out how to make my data request to fire in sequence.
I would like appRoute's loader to fetch the user and make the nested newsRoute wait until the promise is resolved. Then, I want to make news request with proper Now all promises fire at once and don't wait until either of them finishes. However, I need a way to make nested loaders to be pending until upper-level loader promises are resolved, and in case if upper-level promises throw an error I don't want lower-level loaders to fire at all. Is it possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Maybe the example above is not showing the right case of the problem. The other example can be like this: newsRoute loads data only after appRoute finishes some authentication request to determine if the user is authorized and can get news. |
Beta Was this translation helpful? Give feedback.
you can access the parentMatch in the loader via
parentMatchPromise