Skip to content

Conversation

@Freddy03h
Copy link
Member

The typescript type on transformOrigin is very weak

  transformOrigin?: Array<string | number> | string | undefined;

https://github.com/facebook/react-native/blob/4165884b700341ba549ed8385480fd98128e7bb1/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts#L296

Compare to the processTransformOrigin function that analyse the transformOrigin value on DEV mode
https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/StyleSheet/processTransformOrigin.js

@Freddy03h Freddy03h requested a review from cknitt December 9, 2024 11:38
@cknitt
Copy link
Member

cknitt commented Dec 9, 2024

Ok, I get the split in x and y 👍, but can't we keep | @as("left") Left instead of | @as("0%") Left?

@Freddy03h
Copy link
Member Author

Freddy03h commented Dec 9, 2024

No because I found that those keywords aren't handled in the array syntax :(
(that's why I split the change in 2 different commits)

I'll open an issue on the react-native repo, but, since the processTransformOrigin function transform those keywords to 0%, 50% and 100% for the string syntax. I think it's ok to be handled this way, instead of removing the keywords.

@Freddy03h Freddy03h merged commit fd631f4 into main Dec 10, 2024
2 checks passed
@Freddy03h Freddy03h deleted the fix-transform-origin branch December 10, 2024 08:38
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.

3 participants