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

Add warning when passing incorrect transformOrigin #6602

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Conversation

Latropos
Copy link
Contributor

@Latropos Latropos commented Oct 16, 2024

Summary

Some view props, like colors are processed on JS level, so we process it in updateProps function:

However we don't implement our copy of processTransformOrigin and passing transformOrigin in a form of string crashes the app with a confusing error "Exception in HostFunction: , js engine: reanimated"

Yet, if transformOrigin is provided as an array of 3 numbers (just as you would get after calling processTransformOrigin on it) everything works fine, so I've added a warning explaining the problem.

Note

Similarly a fontVariant in form of string passed in useAnimatedStyle will not work. However this is not going to crash the whole app, so we probably want to ignore it. Also fontVariant accepts quantified values, so it doesn't make as much sense to animate it.

Test plan

This crash: #5895 doesn't have misleading error message.

@Latropos Latropos requested a review from tjzel October 22, 2024 08:44
@Latropos Latropos marked this pull request as ready for review October 22, 2024 08:52
@tjzel tjzel added this pull request to the merge queue Oct 30, 2024
Merged via the queue into main with commit 3576131 Oct 30, 2024
9 checks passed
@tjzel tjzel deleted the acynk/transform-origin branch October 30, 2024 16:52
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