mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
fix: change single param to props object in onTransition callba… (#171)
This commit is contained in:
@@ -93,6 +93,10 @@ export type HeaderProps = {
|
||||
styleInterpolator: HeaderStyleInterpolator;
|
||||
};
|
||||
|
||||
export type TransitionCallbackProps = {
|
||||
closing: boolean;
|
||||
};
|
||||
|
||||
export type NavigationStackOptions = HeaderOptions &
|
||||
Partial<TransitionPreset> & {
|
||||
title?: string;
|
||||
@@ -107,8 +111,8 @@ export type NavigationStackOptions = HeaderOptions &
|
||||
vertical?: number;
|
||||
horizontal?: number;
|
||||
};
|
||||
onTransitionStart?: (closing: boolean) => void;
|
||||
onTransitionEnd?: (closing: boolean) => void;
|
||||
onTransitionStart?: (props: TransitionCallbackProps) => void;
|
||||
onTransitionEnd?: (props: TransitionCallbackProps) => void;
|
||||
};
|
||||
|
||||
export type NavigationStackConfig = {
|
||||
|
||||
@@ -263,7 +263,7 @@ export default class Stack extends React.Component<Props, State> {
|
||||
|
||||
descriptor &&
|
||||
descriptor.options.onTransitionStart &&
|
||||
descriptor.options.onTransitionStart(closing);
|
||||
descriptor.options.onTransitionStart({ closing });
|
||||
};
|
||||
|
||||
private handleTransitionEnd = (
|
||||
@@ -274,7 +274,7 @@ export default class Stack extends React.Component<Props, State> {
|
||||
|
||||
descriptor &&
|
||||
descriptor.options.onTransitionEnd &&
|
||||
descriptor.options.onTransitionEnd(closing);
|
||||
descriptor.options.onTransitionEnd({ closing });
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user