Hi folks! I'm using RR7 with lazy-loaded routes like
{
path: "/foo",
lazy: {
Component: async () => {
return (
await import('./path/to/module')
).MyComponent;
},
}
}
This works great, but when a user clicks on a link to /foo their browser needs to first load the JS. This can feel a little slow -- is there anything I can do to improve this situation? For example, can I either:
- show some UI state while fetching the JS, or
- start pre-loading the JS when the user hovers over the
<Link>component?
Thank you!