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 Modal Navigation #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

robharding
Copy link

Hi Josh,
thanks for the great tutorial. I was having issues getting the modals to behave as expected. To reproduce bring up the sign in modal, and then click the sign up button. If you try closing the sign out modal, it brings you back to the sign in modal instead of the expected page. My fix is to replace the page in the router instead of navigating.

@robharding
Copy link
Author

forgot- both files will now need "use client"; on the first line because we are using the onClick hook.

@robharding
Copy link
Author

This broke navigation when opening a modal from the sign up/sign in page, as closing the modal would take you to where you were before that page(not the page itself).

@joschan21
Copy link
Owner

Awesome thanks for the PR, gonna look into it as soon as I find the time

@robharding
Copy link
Author

Instead of onClick, the SignIn and SignUp can use the replace property to replace the current route in the case it's already on a modal.

@JulianBristol
Copy link

Thanks, works well!

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.

4 participants