From 1fc8e8acf322232540ff6ba5a8ab16fa6f527630 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Mon, 23 Dec 2024 15:08:38 +0100 Subject: [PATCH] fix: apply monkey patch synchronously --- src/animated.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/animated.tsx b/src/animated.tsx index 0caa105fd5..7bc268dd49 100644 --- a/src/animated.tsx +++ b/src/animated.tsx @@ -1,5 +1,5 @@ /* eslint react/jsx-sort-props: off */ -import React, { useEffect, useMemo, useRef, useState } from "react"; +import React, { useLayoutEffect, useMemo, useRef, useState } from "react"; import { Animated, Platform, StyleSheet } from "react-native"; import { controlEdgeToEdgeValues, @@ -192,8 +192,8 @@ export const KeyboardProvider = ({ [], ); - // effects - useEffect(() => { + // layout effects + useLayoutEffect(() => { if (enabled) { applyMonkeyPatch(); } else {