Skip to content

[v4] ReanimatedError: Tried to synchronously call a non-worklet function on the UI thread.  #1366

@beqramo

Description

@beqramo

Bug

Hi,
I swipe down the modal to close it and it throws this error.
I think call to the function is wrong

PR has been created:
#1367
image

image

Environment info

Library Version
@gorhom/bottom-sheet 4.4.6
react-native 0.71
react-native-reanimated ~3.1.0
react-native-gesture-handler ~2.9.0

Steps To Reproduce

1.create bottom-sheet input in the bottom-sheet modal
2. try to swipe down to close the modal
3. lib will crash on keyboard close

Describe what you expected to happen:

  1. it shouldn't crash on close

Reproducible sample code

const Modal = () =>{
 const ref = useRef(null);
  const sheetRef = useRef(null);



 const renderBackdrop = useCallback(
    (props) => (
      <BottomSheetBackdrop
        {...props}
        disappearsOnIndex={0}
        appearsOnIndex={1}
      />
    ),
    [],
  );
  
return  (
  <BottomSheet
      ref={sheetRef}
      snapPoints={[250]}
      backdropComponent={renderBackdrop}
    >
      <View>
         <BottomSheetTextInput 
           placeholder={'Enter Amount'}
            keyboardType={'decimal-pad'}
            value={value}
            ref={ref}
         />
      </View>
    </BottomSheet>
   )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions