Skip to content
Discussion options

You must be logged in to vote

Okay I have something that seems to work well using a Splat Route.

Approach:

  1. Use a registry of components using async import functions to ensure code-splitting
  2. In the loader, choose the component we want to render and await its import.
  3. When importing the component we cache the import promise. When the promise resolves we cache the output so we can access it synchronously during server rendering.
  4. In the event that the route was not found during the lookup, we can easily throw notFound() and show the usual 404 page.
  5. Utilize a isomorphic component to render

The isomorphic component works as follows using createIsomorphicFn():

  • On the server, we already awaited the import of the component i…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@cseitz
Comment options

@cseitz
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by cseitz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants