Remove Suspense wrappers from public policy routes - #372
Remove Suspense wrappers from public policy routes#372SaravanakumarR2018 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cab22855b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <Route | ||
| path="terms-of-service" | ||
| element={ | ||
| <Suspense fallback={<LoadingPage />}> | ||
| <TermsOfServicePage /> | ||
| </Suspense> | ||
| } | ||
| element={<TermsOfServicePage />} | ||
| /> |
There was a problem hiding this comment.
Restore Suspense boundary for lazy policy pages
These policy routes still render React.lazy components (TermsOfServicePage, PrivacyPolicyPage, RefundPolicyPage are declared with lazy(...) at the top of this file). With the Suspense wrappers removed, navigating to these routes will throw at runtime (“a component suspended while rendering, but no fallback UI was specified”) because this branch of the route tree only has ContextWrapper/Outlet and no ancestor Suspense boundary. This means public policy pages will fail to render in production unless a higher-level Suspense is reintroduced.
Useful? React with 👍 / 👎.
Motivation
Suspensewith aLoadingPagefallback but do not require lazy-loading behavior.Description
Suspensewrappers forTermsOfServicePage,PrivacyPolicyPage, andRefundPolicyPageinsrc/frontend/src/routes.tsxso they are now rendered aselement={<TermsOfServicePage />}(and equivalents).src/frontend/src/routes.tsxand reduces the Suspense-related boilerplate around these routes.Testing
Codex Task