diff --git a/packages/stack/src/types.tsx b/packages/stack/src/types.tsx index eb6978982ddbe7..7e5ddec665ef48 100644 --- a/packages/stack/src/types.tsx +++ b/packages/stack/src/types.tsx @@ -93,6 +93,10 @@ export type HeaderProps = { styleInterpolator: HeaderStyleInterpolator; }; +export type TransitionCallbackProps = { + closing: boolean; +}; + export type NavigationStackOptions = HeaderOptions & Partial & { 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 = { diff --git a/packages/stack/src/views/Stack/Stack.tsx b/packages/stack/src/views/Stack/Stack.tsx index 8e64cebc0f0729..820e243c19833a 100755 --- a/packages/stack/src/views/Stack/Stack.tsx +++ b/packages/stack/src/views/Stack/Stack.tsx @@ -263,7 +263,7 @@ export default class Stack extends React.Component { 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 { descriptor && descriptor.options.onTransitionEnd && - descriptor.options.onTransitionEnd(closing); + descriptor.options.onTransitionEnd({ closing }); }; render() {