Skip to content

Conversation

@RobinMalfait
Copy link
Member

This PR provides some improvements to the Transition component.

This allows us to guarantee that the ref is always referencing the
latest callback. This also allows us to re-run fewer effects because we
don't really care about intermediate callback values, just the last one.
@vercel
Copy link

vercel bot commented Feb 16, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-react – ./packages/playground-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/47WYBb4vwo9mwAUzopnHQWaNpYbJ
✅ Preview: https://headlessui-react-git-improve-transition-component-tailwindlabs.vercel.app

headlessui-vue – ./packages/playground-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/FUiLWFBeVbYGRy2HpYGHw7usy87B
✅ Preview: https://headlessui-vue-git-improve-transition-component-tailwindlabs.vercel.app

@RobinMalfait RobinMalfait changed the base branch from main to fix/react-transition-bug February 24, 2022 15:07
@RobinMalfait RobinMalfait marked this pull request as ready for review February 24, 2022 15:08
@RobinMalfait RobinMalfait merged commit 21c90df into fix/react-transition-bug Feb 24, 2022
@RobinMalfait RobinMalfait deleted the improve-transition-component branch February 24, 2022 15:09
thecrypticace added a commit that referenced this pull request Feb 28, 2022
This allows us to guarantee that the ref is always referencing the
latest callback. This also allows us to re-run fewer effects because we
don't really care about intermediate callback values, just the last one.
thecrypticace added a commit that referenced this pull request Mar 1, 2022
* Fix React transition bug

* use a ref instead of a useCallback (#1108)

This allows us to guarantee that the ref is always referencing the
latest callback. This also allows us to re-run fewer effects because we
don't really care about intermediate callback values, just the last one.

* Fix tests

* Update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
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