Skip to content

Commit 5815a58

Browse files
committed
chore: fixed layout animation overriding warning
1 parent 5005dca commit 5815a58

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/uikit-react-native/src/hooks/useKeyboardStatus.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ type KeyboardEvents = {
99
hideEvent: KeyboardEventName;
1010
};
1111

12+
let isLayoutAnimationConfigured = false;
13+
1214
const configureNextLayoutAnimation = (event: KeyboardEvent) => {
15+
if (isLayoutAnimationConfigured) return;
1316
const config = LayoutAnimation.create(event.duration, event.easing, LayoutAnimation.Properties.scaleY);
14-
LayoutAnimation.configureNext(config);
17+
isLayoutAnimationConfigured = true;
18+
const onEnd = () => (isLayoutAnimationConfigured = false);
19+
LayoutAnimation.configureNext(config, onEnd, onEnd);
1520
};
1621

1722
const { showEvent, hideEvent } = Platform.select<KeyboardEvents>({

0 commit comments

Comments
 (0)