Skip to content

Commit 57a38f3

Browse files
committed
fix(withTransitionContext): use same props as index component
1 parent 46c38c4 commit 57a38f3

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/withTransitionContext.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import * as React from 'react'
44
import ViewSlider from './index'
5+
import type {Props, DefaultProps} from './index'
56
import TransitionContext from 'react-transition-context'
6-
import type {Prefixer} from 'inline-style-prefixer'
77

88
type TransitionState = 'in' | 'out' | 'entering' | 'leaving'
99

@@ -16,23 +16,8 @@ export type ViewProps = {
1616
ref: (element: React.ElementRef<string>) => mixed,
1717
}
1818

19-
export type Props = {
20-
activeView: number,
21-
numViews: number,
22-
renderView: (props: ViewProps) => React.Node,
23-
animateHeight?: boolean,
24-
transitionDuration?: number,
25-
transitionTimingFunction?: string,
26-
prefixer?: Prefixer,
27-
fillParent?: boolean,
28-
className?: string,
29-
style?: Object,
30-
viewportClassName?: string,
31-
viewportStyle?: Object,
32-
}
33-
3419
export default class ViewSliderWithTransitionContext extends React.Component<Props> {
35-
static defaultProps: Props;
20+
static defaultProps: DefaultProps = ViewSlider.defaultProps;
3621
renderView = (props: ViewProps): React.Element<React.ComponentType<typeof TransitionContext>> => {
3722
return (
3823
<TransitionContext key={props.key} transitionState={props.transitionState}>

0 commit comments

Comments
 (0)