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

fix: reanimated crashes on the latest version, example app crashes #13

Conversation

MatiPl01
Copy link
Contributor

@MatiPl01 MatiPl01 commented Jul 24, 2024

Description

This PR removes unnecessary Animated.createAnimatedComponent call for the Canvas component, which causes crashes on the latest react-native-reanimated version. Since it is not necessary (it takes neither animated style, nor animated props), it can be removed.

I also added missing 'worklet' keywords in gesture handler functions in the example app which were missing and caused crashes for the rect component.

I bumped react-native-gesture-handler and added 'worklet' keyword to callbacks declared on the gesture in the src/canvas/canvas.tsx component as gesture handler started to show warnings in the latest version when 'worklet' is missing.

Repro

You can see the issues I described in the repro on this repository (the main branch).
Patched library with changes from this PR is included in the patched branch.

@@ -62,7 +62,7 @@ export default function App() {
y: cy.value,
}
},
onActive: ({ translationX, translationY }, context) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also incorrect and this example didn't work. The context variable is declared above in the component, so it overrode the variable with undefined.

@enzomanuelmangano
Copy link
Owner

Hi @MatiPl01 thanks a lot for spending time on this PR, I'm sincerely grateful for that. The changes make perfect sense and I will include them in the next version soon. I'm really sorry for the late response

@enzomanuelmangano enzomanuelmangano self-requested a review August 6, 2024 14:04
@enzomanuelmangano enzomanuelmangano merged commit 0b03e13 into enzomanuelmangano:main Aug 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants