Skip to content

Commit e9b6187

Browse files
authored
Use Number instead of parseInt (#6593)
## Summary Replace `parseInt` with `Number`, as the second function correctly handles empty string and undefined. ``` Number(null) = 0 Number('') = 0 parseInt(null) = NaN ``` ## Test plan
1 parent 608a909 commit e9b6187

File tree

1 file changed

+1
-1
lines changed
  • packages/react-native-reanimated/src/layoutReanimation/animationBuilder

1 file changed

+1
-1
lines changed

packages/react-native-reanimated/src/layoutReanimation/animationBuilder/Keyframe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class InnerKeyframe implements IEntryExitAnimationBuilder {
105105
const duration: number = this.durationV ? this.durationV : 500;
106106
const animationKeyPoints: Array<number> = Array.from(
107107
Object.keys(this.definitions)
108-
).map(parseInt);
108+
).map(Number);
109109

110110
const getAnimationDuration = (
111111
key: string,

0 commit comments

Comments
 (0)