Fix double beforeEnter due to SSR (#1183)
* prevent initial transitioning in SSR environment Due to SSR and the hydration step, the transition code was already called even if we were not ready yet. This caused an issue where the `beforeEnter` callback got fired twice intead of once. Fixes: #311 * update changelog
This commit is contained in:
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Improve outside click support ([#1175](https://github.com/tailwindlabs/headlessui/pull/1175))
|
||||
- Ensure that `appear` works regardless of multiple rerenders ([#1179](https://github.com/tailwindlabs/headlessui/pull/1179))
|
||||
- Reset Combobox Input when the value gets reset ([#1181](https://github.com/tailwindlabs/headlessui/pull/1181))
|
||||
- Fix double `beforeEnter` due to SSR ([#1183](https://github.com/tailwindlabs/headlessui/pull/1183))
|
||||
|
||||
## [Unreleased - @headlessui/vue]
|
||||
|
||||
|
||||
@@ -279,6 +279,7 @@ let TransitionChild = forwardRefWithAs(function TransitionChild<
|
||||
useIsoMorphicEffect(() => {
|
||||
let node = container.current
|
||||
if (!node) return
|
||||
if (!ready) return
|
||||
if (skip) return
|
||||
if (show === prevShow.current) return
|
||||
|
||||
@@ -328,6 +329,7 @@ let TransitionChild = forwardRefWithAs(function TransitionChild<
|
||||
container,
|
||||
skip,
|
||||
show,
|
||||
ready,
|
||||
enterClasses,
|
||||
enterFromClasses,
|
||||
enterToClasses,
|
||||
|
||||
Reference in New Issue
Block a user