Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
beqramo opened this issue May 11, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@beqramo
Copy link
Contributor

beqramo commented May 11, 2023

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>
   )
}
@beqramo beqramo added the bug Something isn't working label May 11, 2023
@starnizar
Copy link

starnizar commented May 11, 2023

have same issue
there is path of that hook in warning /node_modules/@garhom/bottom-sheet/src/hooks/useGestureEventHandlersDefault.tsx
hope will be useful

link to image with error

@beqramo
Copy link
Contributor Author

beqramo commented May 11, 2023

@starnizar you can use the pr code changes above that I created.

@akanoce
Copy link

akanoce commented May 30, 2023

The same happens to me on 4.4.6 + reanimated 2.14.4
Rolling back to 4.4.5 fixes the issue

@sawariz0r
Copy link

Also came across this on 4.4.6, reverting to 4.4.5 instead gave me `Trying to access property "dismiss" of an object which cannot be sent to the UI runtime."

Will post updates if I find the root of the cause

@Ricka7x
Copy link

Ricka7x commented Jun 11, 2023

Also ran into the same problem but it works as expected after upgrading to 4.4.7

@beqramo beqramo closed this as completed Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants