-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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: [TS] Update translateX
& translateY
types to support %
#42671
Conversation
@NickGerleman can you review this? |
@retyui thanks for the change! I took a look at transform?:
| $ReadOnlyArray<
| {|+perspective: number | AnimatedNode|}
| {|+rotate: string | AnimatedNode|}
| {|+rotateX: string | AnimatedNode|}
| {|+rotateY: string | AnimatedNode|}
| {|+rotateZ: string | AnimatedNode|}
| {|+scale: number | AnimatedNode|}
| {|+scaleX: number | AnimatedNode|}
| {|+scaleY: number | AnimatedNode|}
| {|+translateX: number | AnimatedNode|}
| {|+translateY: number | AnimatedNode|}
| {|
+translate:
| [number | AnimatedNode, number | AnimatedNode]
| AnimatedNode,
|}
| {|+skewX: string | AnimatedNode|}
| {|+skewY: string | AnimatedNode|}
// TODO: what is the actual type it expects?
| {|
+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
|},
>
| string, |
No, react-native/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts Lines 165 to 171 in 5f75e9b
react-native/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts Lines 129 to 143 in 5f75e9b
|
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @retyui in b133bf6. When will my fix make it into a release? | Upcoming Releases |
react-native/packages/react-native/Libraries/StyleSheet/processTransform.js Lines 257 to 267 in b7b5585
I think percentage is not supported based on processTransform 🤔 or do we need to update processTransform? |
@burakgormek Do you check all code ? I think it works well and don't need to be update |
Summary:
After update to the latest
react-native
versionwe discover that we are unable to use
number%
value fortranslate*
props :percentage values are supported, demo: https://snack.expo.dev/@retyui/test-tstransform
Changelog:
[GENERAL] [FIXED] - Update typescript definition of
translateX
&translateX
to be able to use percentage valuesTest Plan:
yarn tsc --noEmit