Skip to content

Commit 6ac3f97

Browse files
authored
Make children prop type optional
A bug in flow (facebook/flow#1964) prevents it checking in it's children prop has been set in jsx. You can make flow ignorant to this prop by setting it as optional. Addresses chenglou#375
1 parent bdfef4e commit 6ac3f97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Types.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ export type Velocity = {[key: string]: number};
3535
export type MotionProps = {
3636
defaultStyle?: PlainStyle,
3737
style: Style,
38-
children: (interpolatedStyle: PlainStyle) => ReactElement,
38+
children?: (interpolatedStyle: PlainStyle) => ReactElement,
3939
onRest?: () => void,
4040
};
4141

4242
// === StaggeredMotion ===
4343
export type StaggeredProps = {
4444
defaultStyles?: Array<PlainStyle>,
4545
styles: (previousInterpolatedStyles: ?Array<PlainStyle>) => Array<Style>,
46-
children: (interpolatedStyles: Array<PlainStyle>) => ReactElement,
46+
children?: (interpolatedStyles: Array<PlainStyle>) => ReactElement,
4747
};
4848

4949
// === TransitionMotion ===
@@ -65,7 +65,7 @@ export type DidLeave = (styleThatLeft: { key: string, data?: any }) => void;
6565
export type TransitionProps = {
6666
defaultStyles?: Array<TransitionPlainStyle>,
6767
styles: Array<TransitionStyle> | (previousInterpolatedStyles: ?Array<TransitionPlainStyle>) => Array<TransitionStyle>,
68-
children: (interpolatedStyles: Array<TransitionPlainStyle>) => ReactElement,
68+
children?: (interpolatedStyles: Array<TransitionPlainStyle>) => ReactElement,
6969
willEnter?: WillEnter,
7070
willLeave?: WillLeave,
7171
};

0 commit comments

Comments
 (0)