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

Support fallback or loading_view prop in ProtectedRoute #3263

Closed
tqwewe opened this issue Nov 19, 2024 · 2 comments · Fixed by #3264
Closed

Support fallback or loading_view prop in ProtectedRoute #3263

tqwewe opened this issue Nov 19, 2024 · 2 comments · Fixed by #3264

Comments

@tqwewe
Copy link
Contributor

tqwewe commented Nov 19, 2024

Is your feature request related to a problem? Please describe.
The new ProtectedRoute using transition behind the scenes is great. However there doesn't seem to be a way for users to customize the fallback view for when the condition is still being resolved asynchronously.

Describe the solution you'd like
The ProtectedRoute component should have an optional prop for allowing a view to be rendered while the condition is loading. This allows for nice loading screens etc.

@gbj
Copy link
Collaborator

gbj commented Nov 19, 2024

Should be a 1-2 line change to add a fallback and pass it through to the Transition -- Are you interested in making a PR?

@tqwewe
Copy link
Contributor Author

tqwewe commented Nov 19, 2024

Yep sure! I'm a little confused about what to name the new prop. fallback in the Routes component means the view to render if the route isn't matched. Are we fine to use then name fallback in the ProtectedRoute for the transition fallback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants