[react-virtualized] - Allows to set arbitrary props to force re-render (#18378)

* Allows to set arbitrary props to force re-render

* Add myself to "definitions by"

* Fix linting

* Added comment about purpose of arbitrary values
This commit is contained in:
Konstantin Nesterov 2017-07-25 19:38:18 +02:00 committed by Andy
parent af8b0d1294
commit 4e6d9944e4
11 changed files with 82 additions and 1 deletions

View File

@ -21,6 +21,14 @@ export type ArrowKeyStepperProps = {
columnCount: number;
rowCount: number;
mode?: 'edges' | 'cells';
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
}
export type ScrollIndexes = {
scrollToRow: number,

View File

@ -20,6 +20,14 @@ export type AutoSizerProps = {
* ({ height, width }) => PropTypes.element
*/
children?: (props: Dimensions) => React.ReactNode
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
};
/**
* Decorator component that automatically adjusts the width and height of a single child.

View File

@ -53,6 +53,14 @@ export type CellMeasurerProps = {
parent?: React.ReactType;
rowIndex?: number;
style?: React.CSSProperties;
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
}
/**
* Wraps a cell and measures its rendered content.

View File

@ -106,6 +106,14 @@ export type CollectionProps = {
* (vs virtualized) columns.
*/
width: number;
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
};
/**

View File

@ -26,6 +26,14 @@ export type ColumnSizerProps = {
columnCount?: number;
/** Width of Grid or Table child */
width: number;
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
}
/**
* High-order component that auto-calculates column-widths for `Grid` cells.

View File

@ -280,6 +280,14 @@ export type GridCoreProps = {
* Width of Grid; this property determines the number of visible (vs virtualized) columns.
*/
width: number;
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
}
export type GridProps = GridCoreProps & {

View File

@ -44,6 +44,14 @@ export type InfiniteLoaderProps = {
* This value defaults to 15.
*/
threshold?: number;
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
};
/**

View File

@ -46,7 +46,15 @@ export type MasonryProps = {
scrollTop?: number,
style?: React.CSSProperties,
tabIndex?: number,
width: number
width: number,
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
}
export type MasonryState = {

View File

@ -26,6 +26,14 @@ export type ScrollSyncProps = {
* ({ onScroll, scrollLeft, scrollTop }) => PropTypes.element
*/
children?: (props: ScrollSyncChildProps) => React.ReactNode
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
};
export type ScrollSyncState = {

View File

@ -19,6 +19,14 @@ export type WindowScrollerProps = {
onScroll?: (params: { scrollTop: number }) => void;
/** Element to attach scroll event listeners. Defaults to window. */
scrollElement?: HTMLElement;
/**
* PLEASE NOTE
* The [key: string]: any; line is here on purpose
* This is due to the need of force re-render of PureComponent
* Check the following link if you want to know more
* https://github.com/bvaughn/react-virtualized#pass-thru-props
*/
[key: string]: any;
}
export type WindowScrollerState = {
height: number,

View File

@ -2,6 +2,7 @@
// Project: https://github.com/bvaughn/react-virtualized
// Definitions by: Kalle Ott <https://github.com/kaoDev>
// John Gunther <https://github.com/guntherjh>
// Konstantin Nesterov <https://github.com/wasd171>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3