useAnimatedKeyboard causes navigation bar jump with React Navigation on Android

Open
#6,906 11 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react-native, typescript
Domain
mobile

Research direction

Start with the linked Snack and reproduce the transition on Android using the listed React Native, Reanimated, and React Navigation versions. Trace the screen that calls useAnimatedKeyboard and compare navigation-bar behavior with and without that call. Done means the navigation bar no longer jumps when entering that screen while the hook remains enabled.

Written by the indexing model from the issue text.

Description

Platform: Android Repro provided
Description

My navigation bar unexpectedly jumps or shifts when transitioning to a screen implementing useAnimatedKeyboard on Android. This issue disappears when the hook is removed.

Video demo

With useAnimatedKeyboard

https://github.com/user-attachments/assets/b5845fbe-60db-4fa5-a9e0-1fc2f53276d8

Without useAnimatedKeyboard

https://github.com/user-attachments/assets/c1480f5c-3ea7-4503-84ef-268273544686

The only code change between those 2 videos was removing this line in the screen I transitioned to.

const keyboard = useAnimatedKeyboard();

I was able to reproduce the issue on a real device as well as on an Android emulator.

Steps to reproduce
1. Set up a project with React Navigation and Reanimated.
2. Add useAnimatedKeyboard to a component
3. Run the app and navigate to the screen implementing the hook.
Snack or a link to a repository

https://snack.expo.dev/@alexmngn/supportive-yellow-watermelon

Reanimated version

3.16.7

React Native version

0.75.4

React Navigation version

7.0.14

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Debug app & dev bundle

Device

Android emulator
Real device

Device model

Galaxy A22

Acknowledgements

Yes

Dominant language
TypeScript
Stars
11k
Forks
1.5k
Avg merge
3d 4h
Merged PRs (30d)
172

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from software-mansion/react-native-reanimated

All issues in software-mansion/react-native-reanimated

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.