Solution 1 :
I had a similar issue when using LayoutAnimation.configureNext
and React Navigation 5
on Android. I never found the root cause of the problem, but what solved it for me was enabling react-native-screens
Run:
# bare React Native project
npm install react-native-screens
# if you use Expo managed workflow
expo install react-native-screens
Then place the following code at the top of your root file before rendering any screens:
import { enableScreens } from "react-native-screens";
enableScreens();
Note: I am using
Expo SDK 38
, so I’m not sure if this fix is applicable in non-Expo environments. Here is a link to the Expo docs
Problem :
I am handling the keyboard in my app… I have read that the best way to animate it on android is using the LayoutAnimation API, and yeah it works fine but when I navigate back to other screens in which keyboard doesn’t appear an unknown View with the same height of my keyboard is shown.
Has anyone experimented with this problem? On iOS it works perfectly, but not on Android.
I have tried to do UIManager.setLayoutAnimationEnabledExperimental(false); when my component unmounts and this View doesn’t appear when going back, but if I open the keyboard again the animation disappears.
Comments
Comment posted by github.com/facebook/react-native/issues/26551
Found someone with same problem: