Can i lazy load a group of routes? #10813
Unanswered
susantpatel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a group of routes like this
<Route path={RoutePaths.createCourses}> <Route index element={<Layout children={<AddCourses />} />} /> <Route path={RoutePaths.QuizBuilder} element={<QuizBuilder />} /> <Route path={RoutePaths.AssessmentBuilder} element={<QuizBuilder />} /> <Route path={RoutePaths.quiz} element={<QuizBuilder />} /> </Route>
I want the browser to load all the routes at once with lazy load and suspense.
I have tried wrapping the parent route with <Suspense fallback={<>...</>}>
But this throws an error.
Although i can wrap individual elements prop with suspense like this and it works but i want to load multiple routes at once
<Route path={RoutePaths.AssessmentBuilder} element={<Suspense><QuizBuilder /></Suspense>} />
Beta Was this translation helpful? Give feedback.
All reactions