Skip to content

Commit b1cde24

Browse files
authored
Revert "Upgrade typings to flow 0.53.1 (#485)" (#487)
This reverts commit 25230a4.
1 parent 25230a4 commit b1cde24

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

src/Motion.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import stepper from './stepper';
55
import defaultNow from 'performance-now';
66
import defaultRaf from 'raf';
77
import shouldStopAnimation from './shouldStopAnimation';
8-
import * as React from 'react';
8+
import React from 'react';
99
import PropTypes from 'prop-types';
1010

11-
import type {PlainStyle, Style, Velocity, MotionProps} from './Types';
11+
import type {ReactElement, PlainStyle, Style, Velocity, MotionProps} from './Types';
1212

1313
const msPerFrame = 1000 / 60;
1414

@@ -230,7 +230,7 @@ export default class Motion extends React.Component<MotionProps, MotionState> {
230230
}
231231
}
232232

233-
render(): React.Node {
233+
render(): ReactElement {
234234
const renderedChildren = this.props.children(this.state.currentStyle);
235235
return renderedChildren && React.Children.only(renderedChildren);
236236
}

src/StaggeredMotion.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import stepper from './stepper';
55
import defaultNow from 'performance-now';
66
import defaultRaf from 'raf';
77
import shouldStopAnimation from './shouldStopAnimation';
8-
import * as React from 'react';
8+
import React from 'react';
99
import PropTypes from 'prop-types';
1010

11-
import type {PlainStyle, Style, Velocity, StaggeredProps} from './Types';
11+
import type {ReactElement, PlainStyle, Style, Velocity, StaggeredProps} from './Types';
1212

1313
const msPerFrame = 1000 / 60;
1414

@@ -250,7 +250,7 @@ export default class StaggeredMotion extends React.Component<StaggeredProps, Sta
250250
}
251251
}
252252

253-
render(): React.Node {
253+
render(): ReactElement {
254254
const renderedChildren = this.props.children(this.state.currentStyles);
255255
return renderedChildren && React.Children.only(renderedChildren);
256256
}

src/TransitionMotion.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import mergeDiff from './mergeDiff';
66
import defaultNow from 'performance-now';
77
import defaultRaf from 'raf';
88
import shouldStopAnimation from './shouldStopAnimation';
9-
import * as React from 'react';
9+
import React from 'react';
1010
import PropTypes from 'prop-types';
1111

1212
import type {
13+
ReactElement,
1314
PlainStyle,
1415
Velocity,
1516
TransitionStyle,
@@ -536,7 +537,7 @@ export default class TransitionMotion extends React.Component<TransitionProps, T
536537
}
537538
}
538539

539-
render(): React.Node {
540+
render(): ReactElement {
540541
const hydratedStyles = rehydrateStyles(
541542
this.state.mergedPropsStyles,
542543
this.unreadPropStyles,

src/Types.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
// Babel's sight.
55
/* eslint-disable spaced-comment, no-undef */
66
/*::
7-
import * as React from 'react';
7+
import type {Element} from 'react';
8+
export type ReactElement = Element<*>;
89
*/
910

1011
// === basic reused types ===
@@ -34,15 +35,15 @@ export type Velocity = {[key: string]: number};
3435
export type MotionProps = {
3536
defaultStyle?: PlainStyle,
3637
style: Style,
37-
children: (interpolatedStyle: PlainStyle) => React.Node,
38+
children: (interpolatedStyle: PlainStyle) => ReactElement,
3839
onRest?: () => void,
3940
};
4041

4142
// === StaggeredMotion ===
4243
export type StaggeredProps = {
4344
defaultStyles?: Array<PlainStyle>,
4445
styles: (previousInterpolatedStyles: ?Array<PlainStyle>) => Array<Style>,
45-
children: (interpolatedStyles: Array<PlainStyle>) => React.Node,
46+
children: (interpolatedStyles: Array<PlainStyle>) => ReactElement,
4647
};
4748

4849
// === TransitionMotion ===
@@ -64,7 +65,7 @@ export type DidLeave = (styleThatLeft: { key: string, data?: any }) => void;
6465
export type TransitionProps = {
6566
defaultStyles?: Array<TransitionPlainStyle>,
6667
styles: Array<TransitionStyle> | (previousInterpolatedStyles: ?Array<TransitionPlainStyle>) => Array<TransitionStyle>,
67-
children: (interpolatedStyles: Array<TransitionPlainStyle>) => React.Node,
68+
children: (interpolatedStyles: Array<TransitionPlainStyle>) => ReactElement,
6869
willEnter?: WillEnter,
6970
willLeave?: WillLeave,
7071
didLeave?: DidLeave

0 commit comments

Comments
 (0)