@zag-js/react
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -256,6 +256,11 @@ "use client"; | ||
})); | ||
const hydratedStateRef = React.useRef(); | ||
useSafeLayoutEffect(() => { | ||
state.invoke(state.initial, "__init__"); | ||
queueMicrotask(() => { | ||
const initialState = hydratedStateRef.current ?? state.initial; | ||
state.invoke(initialState, "__init__"); | ||
}); | ||
const fns = effects.current; | ||
return () => { | ||
hydratedStateRef.current = state.ref.current; | ||
queueMicrotask(() => { | ||
@@ -262,0 +267,0 @@ fns.forEach((fn) => fn?.()); |
{ | ||
"name": "@zag-js/react", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "The react wrapper for zag", | ||
@@ -28,6 +28,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/core": "1.1.0", | ||
"@zag-js/store": "1.1.0", | ||
"@zag-js/types": "1.1.0", | ||
"@zag-js/utils": "1.1.0" | ||
"@zag-js/core": "1.2.0", | ||
"@zag-js/store": "1.2.0", | ||
"@zag-js/types": "1.2.0", | ||
"@zag-js/utils": "1.2.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
24033
672
+ Added@zag-js/core@1.2.0(transitive)
+ Added@zag-js/dom-query@1.2.0(transitive)
+ Added@zag-js/store@1.2.0(transitive)
+ Added@zag-js/types@1.2.0(transitive)
+ Added@zag-js/utils@1.2.0(transitive)
- Removed@zag-js/core@1.1.0(transitive)
- Removed@zag-js/dom-query@1.1.0(transitive)
- Removed@zag-js/store@1.1.0(transitive)
- Removed@zag-js/types@1.1.0(transitive)
- Removed@zag-js/utils@1.1.0(transitive)
Updated@zag-js/core@1.2.0
Updated@zag-js/store@1.2.0
Updated@zag-js/types@1.2.0
Updated@zag-js/utils@1.2.0