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 appear prop in Transition not working #882

Merged
merged 1 commit into from
Oct 29, 2021
Merged

Fix appear prop in Transition not working #882

merged 1 commit into from
Oct 29, 2021

Conversation

dcastil
Copy link
Contributor

@dcastil dcastil commented Oct 22, 2021

Closes #555.

The useId hook caused a re-render in TransitionChild immediately after mount which triggered a transition by initial being false in the second re-render regardless of how appear was set.

I fixed it by relying on the initial state of the parent Transition component which doesn't get re-rendered at mount.

The `useId` hook causes a re-render in TransitionChild immediately after mount which triggers a transition by `initial` being false in the second re-render regardless of how `appear` was set.
@vercel
Copy link

vercel bot commented Oct 22, 2021

@dcastil is attempting to deploy a commit to the Tailwind Labs Team on Vercel.

A member of the Team first needs to authorize it.

@dcastil dcastil changed the title Fix appear prop not working Fix appear prop in Transition not working Oct 22, 2021
@RobinMalfait RobinMalfait changed the base branch from main to develop October 29, 2021 09:26
@RobinMalfait
Copy link
Member

Hey! Thank you for your PR!
Much appreciated! 🙏

@RobinMalfait RobinMalfait merged commit fd4669f into tailwindlabs:develop Oct 29, 2021
@dcastil dcastil deleted the fix-appear-prop-not-working branch October 29, 2021 09:44
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.

[Bug]: <Transition appear={false}> does not behave as expected
2 participants