gorhom / react-native-bottom-sheet

A performant interactive bottom sheet with fully configurable options 🚀
https://gorhom.dev/react-native-bottom-sheet/
MIT License
7.1k stars 780 forks source link

[v4] | Getting react-native-gesture-handler error on using BottomSheetTextInput #1708

Closed jsonpreet closed 10 months ago

jsonpreet commented 10 months ago

Bug

If I use BottomSheetTextInput I am getting error

Argument 1 (NSNumber) of RNGestureHandlerModule.attachGestureHandler must not be null

RCTLogArgumentError(RCTModuleMethod*, unsigned long, objc_object*, char const*)
    RCTModuleMethod.mm:67
__41-[RCTModuleMethod processMethodSignature]_block_invoke.96
-[RCTModuleMethod invokeWithBridge:module:arguments:]
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_lane_serial_drain
_dispatch_lane_invoke
_dispatch_root_queue_drain_deferred_wlh
_dispatch_workloop_worker_thread
_pthread_wqthread
start_wqthread

Environment info

Library Version
@gorhom/bottom-sheet 4.0.0
react-native 0.72.6
react-native-reanimated 3.3.0
react-native-gesture-handler 2.12.0
const Sheet = ({ snap, marginX, children, sheetRef }) => {
    const bottomSheetModalRef = useRef(null)

    const snapPoints = useMemo(() => snap ?? ['20%', '60%'], [snap])

    const renderBackdrop = useCallback((props) => <BottomSheetBackdrop {...props} opacity={0.5} disappearsOnIndex={-1} appearsOnIndex={0} />, [])

    return (
        <BottomSheetModal
            index={1}
            enableDynamicSizing
            enablePanDownToClose={true}
            enableOverDrag={false}
            enableContentPanningGesture={true}
            animateOnMount={true}
            ref={sheetRef}
            handleComponent={null}
            backgroundStyle={{
                borderRadius: 10,
                backgroundColor: Colors.white,
                borderColor: Colors.grey,
                borderWidth: 0.5,
            }}
            animationConfigs={{
                duration: 200,
            }}
            style={{
                marginHorizontal: 0,
                marginBottom: 0,
                overflow: 'hidden',
                borderRadius: 10,
                paddingHorizontal: 20,
                paddingVertical: 20,
            }}
            keyboardBehavior="fillParent"
            keyboardBlurBehavior="restore"
            detached={false}
            bottomInset={0}
            snapPoints={snapPoints}
            backdropComponent={renderBackdrop}
        >
            {children}
        </BottomSheetModal>
    )
}
github-actions[bot] commented 10 months ago

@jsonpreet: hello! :wave:

This issue is being automatically closed because it does not follow the issue template.