mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-29 04:53:54 +03:00
feat(react-dock): allow ReactNode children in types (#610)
This commit is contained in:
parent
78ded9e0ca
commit
9000e369cd
|
@ -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",
|
||||
|
|
|
@ -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<Props, State> {
|
|||
/>
|
||||
<div style={styles.dockContent}>
|
||||
{typeof children === 'function'
|
||||
? children({
|
||||
? (children as React.FunctionComponent<{
|
||||
position: 'left' | 'right' | 'top' | 'bottom';
|
||||
isResizing: boolean | undefined;
|
||||
size: number;
|
||||
isVisible: boolean | undefined;
|
||||
}>)({
|
||||
position,
|
||||
isResizing,
|
||||
size,
|
||||
|
|
Loading…
Reference in New Issue
Block a user