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

Changing modal prop causes react error crash #541

Open
LordZardeck opened this issue Feb 2, 2025 · 1 comment · May be fixed by #542
Open

Changing modal prop causes react error crash #541

LordZardeck opened this issue Feb 2, 2025 · 1 comment · May be fixed by #542

Comments

@LordZardeck
Copy link

Came across this issue in our app, changing the modal prop between true or false causes a crash with this error:

Rendered fewer hooks than expected. This may be caused by an accidental early return statement.

Discovered it's a cause of having the useCallback hook being executed after the conditional return:
https://github.com/emilkowalski/vaul/blob/main/src/index.tsx#L813

@LordZardeck LordZardeck linked a pull request Feb 2, 2025 that will close this issue
@thehonestfarmer
Copy link

++ I just ran into this issue

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 a pull request may close this issue.

2 participants