mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-02-16 19:40:58 +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": "npm run build:types && npm run build:js",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
"build:types": "tsc --emitDeclarationOnly",
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
|
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
|
||||||
"clean": "rimraf lib umd",
|
"clean": "rimraf lib",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint . --ext .ts,.tsx",
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
"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 PropTypes from 'prop-types';
|
||||||
import debounce from 'lodash.debounce';
|
import debounce from 'lodash.debounce';
|
||||||
import autoprefix from './autoprefix';
|
import autoprefix from './autoprefix';
|
||||||
|
@ -227,12 +227,14 @@ interface Props {
|
||||||
dockStyle?: React.CSSProperties | null;
|
dockStyle?: React.CSSProperties | null;
|
||||||
dockHiddenStyle?: React.CSSProperties | null;
|
dockHiddenStyle?: React.CSSProperties | null;
|
||||||
duration: number;
|
duration: number;
|
||||||
children?: React.FunctionComponent<{
|
children?:
|
||||||
position: 'left' | 'right' | 'top' | 'bottom';
|
| React.FunctionComponent<{
|
||||||
isResizing: boolean | undefined;
|
position: 'left' | 'right' | 'top' | 'bottom';
|
||||||
size: number;
|
isResizing: boolean | undefined;
|
||||||
isVisible: boolean | undefined;
|
size: number;
|
||||||
}>;
|
isVisible: boolean | undefined;
|
||||||
|
}>
|
||||||
|
| ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
|
@ -376,7 +378,12 @@ export default class Dock extends Component<Props, State> {
|
||||||
/>
|
/>
|
||||||
<div style={styles.dockContent}>
|
<div style={styles.dockContent}>
|
||||||
{typeof children === 'function'
|
{typeof children === 'function'
|
||||||
? children({
|
? (children as React.FunctionComponent<{
|
||||||
|
position: 'left' | 'right' | 'top' | 'bottom';
|
||||||
|
isResizing: boolean | undefined;
|
||||||
|
size: number;
|
||||||
|
isVisible: boolean | undefined;
|
||||||
|
}>)({
|
||||||
position,
|
position,
|
||||||
isResizing,
|
isResizing,
|
||||||
size,
|
size,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user