Skip to content

Commit 7cc1c90

Browse files
authored
fix: respect immediate option to useResize hook (#2375)
1 parent 197e0a7 commit 7cc1c90

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/hot-socks-whisper.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@react-spring/core': patch
3+
---
4+
5+
Respect `immediate` option to `useResize` hook

packages/core/src/hooks/useResize.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export const useResize = ({
5757
width,
5858
height,
5959
immediate:
60-
sizeValues.width.get() === 0 || sizeValues.height.get() === 0,
60+
sizeValues.width.get() === 0 ||
61+
sizeValues.height.get() === 0 ||
62+
springOptions.immediate === true,
6163
})
6264
},
6365
{ container: container?.current || undefined }

0 commit comments

Comments
 (0)