Skip to content

Commit a32cad7

Browse files
committed
fix(flow): remove remaining import *
1 parent 0de661f commit a32cad7

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

lib/GridItem.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// @flow
2-
import * as React from 'react';
2+
import React from 'react';
33
import PropTypes from 'prop-types';
44
import {DraggableCore} from 'react-draggable';
55
import {Resizable} from 'react-resizable';
66
import {perc, setTopLeft, setTransform} from './utils';
77
import classNames from 'classnames';
8+
import type {Element as ReactElement, Node as ReactNode} from 'react';
89

9-
import type {ReactDraggableCallbackData, GridDragEvent, GridResizeEvent, Position, Size} from './utils';
10+
import type {ReactDraggableCallbackData, GridDragEvent, GridResizeEvent, Position} from './utils';
1011

1112
type PartialPosition = {top: number, left: number};
1213
type GridItemCallback<Data: GridDragEvent | GridResizeEvent> = (i: string, w: number, h: number, Data) => void;
@@ -18,7 +19,7 @@ type State = {
1819
};
1920

2021
type Props = {
21-
children: React.Element<any>,
22+
children: ReactElement<any>,
2223
cols: number,
2324
containerWidth: number,
2425
margin: [number, number],
@@ -275,7 +276,7 @@ export default class GridItem extends React.Component<Props, State> {
275276
* @param {Element} child Child element.
276277
* @return {Element} Child wrapped in Draggable.
277278
*/
278-
mixinDraggable(child: React.Element<any>): React.Element<any> {
279+
mixinDraggable(child: ReactElement<any>): ReactElement<any> {
279280
return (
280281
<DraggableCore
281282
onStart={this.onDragHandler('onDragStart')}
@@ -294,7 +295,7 @@ export default class GridItem extends React.Component<Props, State> {
294295
* @param {Object} position Position object (pixel values)
295296
* @return {Element} Child wrapped in Resizable.
296297
*/
297-
mixinResizable(child: React.Element<any>, position: Position): React.Element<any> {
298+
mixinResizable(child: ReactElement<any>, position: Position): ReactElement<any> {
298299
const {cols, x, minW, minH, maxW, maxH} = this.props;
299300

300301
// This is the max possible width - doesn't go to infinity because of the width of the window
@@ -399,7 +400,7 @@ export default class GridItem extends React.Component<Props, State> {
399400
};
400401
}
401402

402-
render(): React.Node {
403+
render(): ReactNode {
403404
const {x, y, w, h, isDraggable, isResizable, useCSSTransforms} = this.props;
404405

405406
const pos = this.calcPosition(x, y, w, h, this.state);

lib/ResponsiveReactGridLayout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @flow
2-
import * as React from 'react';
2+
import React from 'react';
33
import PropTypes from 'prop-types';
44
import isEqual from 'lodash.isequal';
55

lib/components/WidthProvider.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// @flow
2-
import * as React from "react";
2+
import React from "react";
33
import PropTypes from 'prop-types';
44
import ReactDOM from 'react-dom';
5+
import type {ComponentType as ReactComponentType} from 'react';
56

67
type Props = {
78
className?: string,
@@ -16,7 +17,7 @@ type State = {
1617
/*
1718
* A simple HOC that provides facility for listening to container resizes.
1819
*/
19-
type ProviderT = (ComposedComponent: React.ComponentType<any>) => React.ComponentType<any>;
20+
type ProviderT = (ComposedComponent: ReactComponentType<any>) => ReactComponentType<any>;
2021
const WidthProvider: ProviderT = (ComposedComponent) => class extends React.Component<Props, State> {
2122

2223
static defaultProps = {

0 commit comments

Comments
 (0)