Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: React Router V7 not working with lazy route elements #322

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

AndreaCuneo
Copy link
Contributor

@AndreaCuneo AndreaCuneo commented Jan 10, 2025

Based on remix-run/react-router#12474, port to:

  • RouteConfig instead of elements
  • Add 'key' on each lazy Route
  • Add 'lazy' property to Sections to support adding the 'key' property

Using the React Router 'lazy' property works too, but introduce another bug: doesn't support displaying a Fallback component while waiting for a page to load. Routing remains on the old 'route' until the lazy resolve.

@AndreaCuneo AndreaCuneo enabled auto-merge January 10, 2025 18:31
@AndreaCuneo AndreaCuneo requested a review from Mirko92 January 10, 2025 18:32
@AndreaCuneo AndreaCuneo force-pushed the bugfix/router_fails_on_lazy branch 2 times, most recently from 365e25e to aa03aa7 Compare January 10, 2025 18:34
@AndreaCuneo AndreaCuneo force-pushed the bugfix/router_fails_on_lazy branch from aa03aa7 to e4f9a84 Compare January 15, 2025 10:26
@AndreaCuneo AndreaCuneo merged commit 8694b64 into master Jan 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants