React-Native

[React-Native]react-native bottomSheetModal not working

AgileJung 2023. 3. 10. 17:45
728x90
반응형

문제점

기존 앱 개발을 안드로이드 지원할 생각이 없었는데, 안드로이드를 지원하게 되면서 기존에 사용하던 

react-native-bottom-sheet 란 라이브러리가 작동이 안되었다..

https://github.com/gorhom/react-native-bottom-sheet

 

 

해결방법

index.js

/**
 * @format
 */
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => gestureHandlerRootHOC(App));

기존에는

AppRegistry.registerComponent(appName, () => App);

위와 같이 되어있었는데 gestureHandlerRootHOC 로 감싸서 작성해주면 기존의 라이브러리를 사용했을때, 모달과 바텀시트가 정상작동되었다.

 

react-native bottomSheetModal not working

 

https://stackoverflow.com/questions/67687631/gorhom-react-native-bottom-sheet-doesnt-work-on-android

 

@gorhom/react-native-bottom-sheet doesn't work on Android

I've been using the library to create bottom sheet modals for my react native app, but it's doesn't seem to work on Android, but on iOS it does. I used the same backdrop component and handle compon...

stackoverflow.com

 

728x90
반응형