diff --git a/packages/react-dock/package.json b/packages/react-dock/package.json index cb42d50d..04690e13 100644 --- a/packages/react-dock/package.json +++ b/packages/react-dock/package.json @@ -31,7 +31,7 @@ "build": "npm run build:types && npm run build:js", "build:types": "tsc --emitDeclarationOnly", "build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline", - "clean": "rimraf lib umd", + "clean": "rimraf lib", "test": "jest", "lint": "eslint . --ext .ts,.tsx", "lint:fix": "eslint . --ext .ts,.tsx --fix", diff --git a/packages/react-dock/src/Dock.tsx b/packages/react-dock/src/Dock.tsx index 2889032a..d06c5e8f 100644 --- a/packages/react-dock/src/Dock.tsx +++ b/packages/react-dock/src/Dock.tsx @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React, { Component, ReactNode } from 'react'; import PropTypes from 'prop-types'; import debounce from 'lodash.debounce'; import autoprefix from './autoprefix'; @@ -227,12 +227,14 @@ interface Props { dockStyle?: React.CSSProperties | null; dockHiddenStyle?: React.CSSProperties | null; duration: number; - children?: React.FunctionComponent<{ - position: 'left' | 'right' | 'top' | 'bottom'; - isResizing: boolean | undefined; - size: number; - isVisible: boolean | undefined; - }>; + children?: + | React.FunctionComponent<{ + position: 'left' | 'right' | 'top' | 'bottom'; + isResizing: boolean | undefined; + size: number; + isVisible: boolean | undefined; + }> + | ReactNode; } interface State { @@ -376,7 +378,12 @@ export default class Dock extends Component { />
{typeof children === 'function' - ? children({ + ? (children as React.FunctionComponent<{ + position: 'left' | 'right' | 'top' | 'bottom'; + isResizing: boolean | undefined; + size: number; + isVisible: boolean | undefined; + }>)({ position, isResizing, size,