-
Notifications
You must be signed in to change notification settings - Fork 3k
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
WIP: Replace react-native
Animated API with react-native-reanimated
#52956
WIP: Replace react-native
Animated API with react-native-reanimated
#52956
Conversation
() => | ||
StyleUtils.getTooltipStyles({ | ||
// eslint-disable-next-line react-compiler/react-compiler | ||
tooltip: rootWrapper.current, | ||
currentSize: animation, | ||
currentSize: animation.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be removed, right? And the logic inside getTooltipStyles adjusted so that animationStyles aren't returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will correct it, I didn't want to change utils that are already written, but I can safely remove it is not used anywhere
() => | ||
StyleUtils.getTooltipStyles({ | ||
tooltip: rootWrapper.current, | ||
currentSize: animation, | ||
currentSize: animation.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -1,12 +1,13 @@ | |||
import type {Animated} from 'react-native'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eslint failing @sumo-slonik
runOnJS(() => { | ||
isAnimationCanceledShared.value = !finished; | ||
})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why do we need to run it on JS thread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will correct it in that case if it is not needed :)
const animationSharedValue = useSharedValue<number>(0); | ||
const isTooltipSenseInitiatorShared = useSharedValue<boolean>(true); | ||
const isAnimationCanceledShared = useSharedValue<boolean>(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to add SharedValue and Shared suffixes to these variables, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do without it
})(); | ||
}, | ||
), | ||
); | ||
} | ||
TooltipSense.activate(); | ||
}, [shouldForceAnimate]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More ESLint warining, you need to add these shared values as dependencies (they won't cause reruns as these are stable references)
@@ -269,6 +276,21 @@ const createTooltipStyleUtils: StyleUtilGenerator<GetTooltipStylesStyleUtil> = ( | |||
}, | |||
}; | |||
}, | |||
|
|||
// Utility function to create and manage scale animations with React Native Reanimated | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -269,6 +276,21 @@ const createTooltipStyleUtils: StyleUtilGenerator<GetTooltipStylesStyleUtil> = ( | |||
}, | |||
}; | |||
}, | |||
|
|||
// Utility function to create and manage scale animations with React Native Reanimated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use JSDoc syntax, this way when you hover over functions you get intellisense 😄
// Utility function to create and manage scale animations with React Native Reanimated | |
/** Utility function to create and manage scale animations with React Native Reanimated */ |
b9b6785
to
334a0de
Compare
3744f48
to
e20c704
Compare
Explanation of Change
Fixed Issues
$ #52920
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop