Flatlist header component getting unmount and mount when modal opens and closes
Description
Flatlist ListHeaderComponent getting unmount and mount when modal opens and closes. This issue is happening with functional component only , in class component it is working as expected.
React Native Version
0.71.3
Output of npx react-native info
System: OS: macOS 13.2.1 CPU: (8) arm64 Apple M2 Memory: 186.02 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 14.21.3 - /opt/homebrew/bin/node Yarn: Not Found npm: 6.14.18 - /opt/homebrew/bin/npm Watchman: 2023.02.13.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 11.0.18 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.3 => 0.71.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
I have added the snack link below .
- Just run the code in iOS or Android.
- Click on any of the items of flatlist.
- You can see a blink in header component and you can find Unmount and mount logs in the console.
https://user-images.githubusercontent.com/37132763/223703231-d5d46c4d-4109-4c12-8eb3-5b0e3075713d.mp4
Snack, code example, screenshot, or link to a repository
https://snack.expo.dev/7ozpQLyfb