react-native-swipeable-item icon indicating copy to clipboard operation
react-native-swipeable-item copied to clipboard

Uncaught TypeError: Cannot read properties of undefined (reading 'previousStyle') when experimenting readme example

Open tiagocpeixoto opened this issue 3 years ago • 6 comments

This package has external dependencies of react-native-reanimated and react-native-gesture-handler which must be installed separately. Before opening an issue related to animations or gestures please verify that you have completed ALL installation steps, including the changes to MainActivity.

Describe the bug When experimenting with the readme example and after swiping any list item, I got the error "Uncaught TypeError: Cannot read properties of undefined (reading 'previousStyle')". After that, the browser almost froze during this weird error.

Steps to reproduce the behavior:

Just try the readme example.

Platform & Dependencies Please list any applicable dependencies in addition to those below (react-navigation etc).

Not applied?

Platform (iOS/Android): React Native or Expo version: Expo v43.0.3 react-native-reanimated version: 2.2.4 react-native-gesture-handler version: 1.10.3

Additional context

The error was raised when testing the example on the web browser (using react-native-web).

tiagocpeixoto avatar Nov 15 '21 15:11 tiagocpeixoto

Hm the web example works fine for me: https://snack.expo.dev/@computerjazz/swipeable-draggable-list I'm not sure where previousStyle is coming from — is that something you added? Can you post a snack showing the bug?

computerjazz avatar Nov 15 '21 17:11 computerjazz

Thanks for your reply. I'm going to check it again.

tiagocpeixoto avatar Nov 15 '21 20:11 tiagocpeixoto

After testing it again, I found that using the Android Emulator everything works fine. But the problem arises when I run it with react-native-web, which is when the reported error occurs.

Any tips?

Thanks again.

tiagocpeixoto avatar Nov 15 '21 21:11 tiagocpeixoto

without seeing how you're using previousStyle I can't offer any suggestions. No references to previousStyle exist in this codebase.

computerjazz avatar Nov 16 '21 00:11 computerjazz

Hey @tiagocpeixoto, have you tried downgrading react-native-reanimated to version 2.2.3? I had the same error in a different project, and downgrading the reanimated version solved the problem.

echamudi avatar Nov 21 '21 12:11 echamudi

ah yep, it's an error with reanimated: https://github.com/software-mansion/react-native-reanimated/issues/2635

computerjazz avatar Nov 21 '21 15:11 computerjazz