-
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
Fix Page Animations #2956
Fix Page Animations #2956
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Navigation's transitionEnd is not reliable on IOS thus we use InteractonManager | ||
* Some information https://github.com/software-mansion/react-native-screens/issues/713 | ||
*/ | ||
import {InteractionManager} from 'react-native'; | ||
|
||
/** | ||
* Call the callback after screen transiton has ended | ||
* | ||
* @param {Object} navigation Screen navigation prop | ||
* @param {Function} callback Method to call | ||
* @returns {Function} | ||
*/ | ||
function onScreenTransitionEnd(navigation, callback) { | ||
const handle = InteractionManager.runAfterInteractions(callback); | ||
return () => handle.cancel(); | ||
} | ||
|
||
export default onScreenTransitionEnd; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Str from 'expensify-common/lib/str'; | ||
|
||
/** | ||
* Call the callback after screen transiton has ended | ||
* | ||
* @param {Object} navigation Screen navigation prop | ||
* @param {Function} callback Method to call | ||
* @returns {Function} | ||
*/ | ||
function onScreenTransitionEnd(navigation, callback) { | ||
return navigation.addListener('transitionEnd', evt => Str.result(callback, evt)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to skip the test if callback is present. But yeah we can jus pass the callback directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add these in a new PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dropped a PR #3228. Thanks. |
||
} | ||
|
||
export default onScreenTransitionEnd; |
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.