diff --git a/types/alt/index.d.ts b/types/alt/index.d.ts index 515a67986a..573fbdbac1 100644 --- a/types/alt/index.d.ts +++ b/types/alt/index.d.ts @@ -148,7 +148,7 @@ declare module "alt/AltContainer" { stores?:Array>; inject?:{[key:string]:any}; actions?:{[key:string]:Object}; - render?:(...props:Array) => React.ReactElement; + render?:(...props:Array) => React.ReactElement; flux?:AltJS.Alt; transform?:(store:AltJS.AltStore, actions:any) => any; shouldComponentUpdate?:(props:any) => boolean; diff --git a/types/atlaskit__button/index.d.ts b/types/atlaskit__button/index.d.ts index 95ac1e0961..915417945c 100644 --- a/types/atlaskit__button/index.d.ts +++ b/types/atlaskit__button/index.d.ts @@ -42,9 +42,9 @@ export interface ButtonProps { /** Provides a url for buttons being used as a link. */ readonly href?: string; /** Places an icon within the button, after the button's text. */ - readonly iconAfter?: ReactElement; + readonly iconAfter?: ReactElement; /** Places an icon within the button, before the button's text. */ - readonly iconBefore?: ReactElement; + readonly iconBefore?: ReactElement; /** Pass a reference on to the styled component */ readonly innerRef?: (instance: any) => void; /** Provide a unique id to the button. */ diff --git a/types/atlaskit__inline-edit/index.d.ts b/types/atlaskit__inline-edit/index.d.ts index d2d706c5a4..b9371f6a69 100644 --- a/types/atlaskit__inline-edit/index.d.ts +++ b/types/atlaskit__inline-edit/index.d.ts @@ -12,9 +12,9 @@ export interface BaseProps { /** Label above the input. */ label?: string; /** Component to be shown when reading only */ - readView: ReactElement; + readView: ReactElement; /** Component to be shown when editing. Should be an @atlaskit/input. */ - editView?: ReactElement; + editView?: ReactElement; /** Set whether the read view should fit width, most obvious when hovered. */ isFitContainerWidthReadView?: boolean; /** Greys out text and shows spinner. Does not disable input. */ @@ -38,7 +38,7 @@ export interface BaseProps { /** Set whether default stylings should be disabled when editing. */ disableEditViewFieldBase?: boolean; /** Component to be shown in an @atlaskit/inline-dialog when edit view is open. */ - invalidMessage?: ReactElement; + invalidMessage?: ReactElement; } export interface StatelessProps extends BaseProps { diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 4c00e7598f..2f58d64a52 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -623,7 +623,7 @@ declare namespace Draft { interface DraftBlockRenderConfig { element: string; - wrapper?: React.ReactElement; + wrapper?: React.ReactElement; } class EditorState extends Record { diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 0c7e2c2e90..343e04eae0 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -82,8 +82,8 @@ function ShallowWrapperTest() { let shallowWrapper: ShallowWrapper = shallow(); - let reactElement: ReactElement; - let reactElements: Array>; + let reactElement: ReactElement; + let reactElements: Array; let domElement: Element; let boolVal: boolean; let stringVal: string; @@ -484,8 +484,8 @@ function ReactWrapperTest() { let reactWrapper: ReactWrapper = mount(); - let reactElement: ReactElement; - let reactElements: Array>; + let reactElement: ReactElement; + let reactElements: Array; let domElement: Element; let boolVal: boolean; let stringVal: string; diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index d9f858d2a7..631a0349c1 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -57,32 +57,32 @@ export interface CommonWrapper

> { /** * Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in. */ - contains(node: ReactElement | Array> | string): boolean; + contains(node: ReactElement | Array | string): boolean; /** * Returns whether or not a given react element exists in the shallow render tree. */ - containsMatchingElement(node: ReactElement | Array>): boolean; + containsMatchingElement(node: ReactElement | Array): boolean; /** * Returns whether or not all the given react elements exists in the shallow render tree */ - containsAllMatchingElements(nodes: Array> | Array>>): boolean; + containsAllMatchingElements(nodes: Array | Array>): boolean; /** * Returns whether or not one of the given react elements exists in the shallow render tree. */ - containsAnyMatchingElements(nodes: Array> | Array>>): boolean; + containsAnyMatchingElements(nodes: Array | Array>): boolean; /** * Returns whether or not the current render tree is equal to the given node, based on the expected value. */ - equals(node: ReactElement): boolean; + equals(node: ReactElement): boolean; /** * Returns whether or not a given react element matches the shallow render tree. */ - matchesElement(node: ReactElement): boolean; + matchesElement(node: ReactElement): boolean; /** * Returns whether or not the current node has a className prop including the passed in class name. @@ -130,27 +130,27 @@ export interface CommonWrapper

> { /** * Returns the node at a given index of the current wrapper. */ - get(index: number): ReactElement; + get(index: number): ReactElement; /** * Returns the wrapper's underlying node. */ - getNode(): ReactElement; + getNode(): ReactElement; /** * Returns the wrapper's underlying nodes. */ - getNodes(): Array>; + getNodes(): Array; /** * Returns the wrapper's underlying node. */ - getElement(): ReactElement; + getElement(): ReactElement; /** * Returns the wrapper's underlying node. */ - getElements(): Array>; + getElements(): Array; /** * Returns the outer most DOMComponent of the current wrapper. diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index f48d01b75d..16d4107e24 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -2702,7 +2702,7 @@ export class Svg extends Component<{ width: number, height: number, viewBox?: st * Take Snapshot */ export function takeSnapshotAsync( - node: number | React.ReactElement | React.RefObject, + node: number | React.ReactElement | React.RefObject, options?: { width?: number; height?: number; diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index b5c327f6a1..34f589c187 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -1517,7 +1517,7 @@ export class RadialGradient extends Component { } * Take Snapshot */ export function takeSnapshotAsync( - view?: (number | React.ReactElement), + view?: (number | React.ReactElement), options?: { width?: number, height?: number, diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 7c515a0268..aa348eb80d 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -2058,7 +2058,7 @@ export class Svg extends Component<{ width: number, height: number }> { * Take Snapshot */ export function takeSnapshotAsync( - view?: (number | React.ReactElement), + view?: (number | React.ReactElement), options?: { width?: number, height?: number, diff --git a/types/expo/v25/index.d.ts b/types/expo/v25/index.d.ts index 9e2da6c790..d65cd76913 100644 --- a/types/expo/v25/index.d.ts +++ b/types/expo/v25/index.d.ts @@ -2087,7 +2087,7 @@ export class Svg extends Component<{ width: number, height: number }> { * Take Snapshot */ export function takeSnapshotAsync( - view?: (number | React.ReactElement), + view?: (number | React.ReactElement), options?: { width?: number, height?: number, diff --git a/types/expo/v26/index.d.ts b/types/expo/v26/index.d.ts index e8386db63c..32e00de424 100644 --- a/types/expo/v26/index.d.ts +++ b/types/expo/v26/index.d.ts @@ -2115,7 +2115,7 @@ export class Svg extends Component<{ width: number, height: number, viewBox?: st * Take Snapshot */ export function takeSnapshotAsync( - view?: (number | React.ReactElement), + view?: (number | React.ReactElement), options?: { width?: number, height?: number, diff --git a/types/expo/v27/index.d.ts b/types/expo/v27/index.d.ts index 179315ba69..dd5e2b90f2 100644 --- a/types/expo/v27/index.d.ts +++ b/types/expo/v27/index.d.ts @@ -2194,7 +2194,7 @@ export class Svg extends Component<{ width: number, height: number, viewBox?: st * Take Snapshot */ export function takeSnapshotAsync( - view?: (number | React.ReactElement), + view?: (number | React.ReactElement), options?: { width?: number, height?: number, diff --git a/types/expo/v30/index.d.ts b/types/expo/v30/index.d.ts index 8a77777c49..f1b318414e 100644 --- a/types/expo/v30/index.d.ts +++ b/types/expo/v30/index.d.ts @@ -2195,7 +2195,7 @@ export class Svg extends Component<{ width: number, height: number, viewBox?: st * Take Snapshot */ export function takeSnapshotAsync( - view?: (number | React.ReactElement), + view?: (number | React.ReactElement), options?: { width?: number, height?: number, diff --git a/types/expo/v31/index.d.ts b/types/expo/v31/index.d.ts index 5f560a8546..cc72cedd67 100644 --- a/types/expo/v31/index.d.ts +++ b/types/expo/v31/index.d.ts @@ -2652,7 +2652,7 @@ export class Svg extends Component<{ width: number, height: number, viewBox?: st * Take Snapshot */ export function takeSnapshotAsync( - view?: (number | React.ReactElement), + view?: (number | React.ReactElement), options?: { width?: number, height?: number, diff --git a/types/fixed-data-table-2/index.d.ts b/types/fixed-data-table-2/index.d.ts index 16b0c0f3c5..08c3458e84 100644 --- a/types/fixed-data-table-2/index.d.ts +++ b/types/fixed-data-table-2/index.d.ts @@ -30,7 +30,7 @@ export interface ColumnReorderEndEvent { reorderColumn: string; } -export type ElementOrFunc

= string | React.ReactElement | ((props: P) => (string | React.ReactElement)); +export type ElementOrFunc

= string | React.ReactElement | ((props: P) => (string | React.ReactElement)); export type TableRowEventHandler = (event: React.SyntheticEvent, rowIndex: number) => void; @@ -616,7 +616,7 @@ export interface ColumnGroupProps extends React.ClassAttributes { * You can also pass in a function that returns a react elemnt, with the * props object above passed in as the first parameter. */ - header?: string | React.ReactElement | ((props: ColumnGroupHeaderProps) => (string | React.ReactElement)); + header?: string | React.ReactElement | ((props: ColumnGroupHeaderProps) => (string | React.ReactElement)); } export class ColumnGroup extends React.Component { diff --git a/types/fixed-data-table/fixed-data-table-tests.tsx b/types/fixed-data-table/fixed-data-table-tests.tsx index 758b33d2a2..3c54d553bd 100644 --- a/types/fixed-data-table/fixed-data-table-tests.tsx +++ b/types/fixed-data-table/fixed-data-table-tests.tsx @@ -3,7 +3,7 @@ import { Table, Cell, Column, CellProps } from "fixed-data-table"; // create your Table class MyTable1 extends React.Component { - render(): React.ReactElement { + render(): React.ReactElement { return (
{ + render(): React.ReactElement { return (
{ ] }; - render(): React.ReactElement { + render(): React.ReactElement { return (
{ - render(): React.ReactElement { + render(): React.ReactElement { const {rowIndex, field, myData} = this.props; return ( @@ -101,7 +101,7 @@ class MyTextCell extends React.Component { } class MyLinkCell extends React.Component { - render(): React.ReactElement { + render(): React.ReactElement { const {rowIndex, field, myData} = this.props; const link: string = myData[rowIndex][field]; @@ -133,7 +133,7 @@ class MyTable4 extends React.Component<{}, MyTable4State> { ] }; - render(): React.ReactElement { + render(): React.ReactElement { return (
{ // Listen for events class MyTable5 extends React.Component { - render(): React.ReactElement { + render(): React.ReactElement { return (
| ((props: CellProps) => (string | React.ReactElement)); + header?: string | React.ReactElement | ((props: CellProps) => (string | React.ReactElement)); /** * This is the body cell that will be cloned for this @@ -315,7 +315,7 @@ declare namespace FixedDataTable { * If you pass in a function, you will receive the same * props object as the first argument. */ - cell?: string | React.ReactElement | ((props: CellProps) => (string | React.ReactElement)); + cell?: string | React.ReactElement | ((props: CellProps) => (string | React.ReactElement)); /** * The footer cell for this column. This can either be a @@ -338,7 +338,7 @@ declare namespace FixedDataTable { * If you pass in a function, you will receive the same * props object as the first argument. */ - footer?: string | React.ReactElement | ((props: CellProps) => (string | React.ReactElement)); + footer?: string | React.ReactElement | ((props: CellProps) => (string | React.ReactElement)); /** * This is used to uniquely identify the column, and is not @@ -440,7 +440,7 @@ declare namespace FixedDataTable { * If you pass in a function, you will receive the same props * object as the first argument. */ - header: string | React.ReactElement | ((props: CellProps) => (string | React.ReactElement)); + header: string | React.ReactElement | ((props: CellProps) => (string | React.ReactElement)); } /** diff --git a/types/gestalt/index.d.ts b/types/gestalt/index.d.ts index dd9ff81e41..9b7c0ead65 100644 --- a/types/gestalt/index.d.ts +++ b/types/gestalt/index.d.ts @@ -786,7 +786,7 @@ export interface ToastProps { color?: "darkGray" | "orange"; icon?: "arrow-circle-forward"; text?: string | ReadonlyArray; - thumbnail?: React.ReactElement; + thumbnail?: React.ReactElement; } /* diff --git a/types/jsnox/jsnox-tests.ts b/types/jsnox/jsnox-tests.ts index f03c33e917..be5bd64126 100644 --- a/types/jsnox/jsnox-tests.ts +++ b/types/jsnox/jsnox-tests.ts @@ -9,7 +9,7 @@ interface PersonProps { } class Person extends React.Component { - render(): React.ReactElement { return null; } + render(): React.ReactElement { return null; } } const PersonTag = React.createFactory(Person); diff --git a/types/lingui__macro/Trans.d.ts b/types/lingui__macro/Trans.d.ts index c1834b770d..ba950bb2be 100644 --- a/types/lingui__macro/Trans.d.ts +++ b/types/lingui__macro/Trans.d.ts @@ -6,7 +6,7 @@ export interface TransPropsWithoutI18n extends RenderProps { defaults?: string; values?: object; formats?: object; - components?: ReadonlyArray>; + components?: ReadonlyArray; children?: ReactNode; } diff --git a/types/lingui__react/Trans.d.ts b/types/lingui__react/Trans.d.ts index c1834b770d..ba950bb2be 100644 --- a/types/lingui__react/Trans.d.ts +++ b/types/lingui__react/Trans.d.ts @@ -6,7 +6,7 @@ export interface TransPropsWithoutI18n extends RenderProps { defaults?: string; values?: object; formats?: object; - components?: ReadonlyArray>; + components?: ReadonlyArray; children?: ReactNode; } diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 285d949d70..7981f9daa0 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -559,8 +559,8 @@ declare namespace __MaterialUI { className?: string; iconClassNameLeft?: string; iconClassNameRight?: string; - iconElementLeft?: React.ReactElement; - iconElementRight?: React.ReactElement; + iconElementLeft?: React.ReactElement; + iconElementRight?: React.ReactElement; iconStyleRight?: React.CSSProperties; iconStyleLeft?: React.CSSProperties; onLeftIconButtonClick?: React.MouseEventHandler<{}>; @@ -654,7 +654,7 @@ declare namespace __MaterialUI { backgroundColor?: string; className?: string; color?: string; - icon?: React.ReactElement; + icon?: React.ReactElement; size?: number; src?: string; style?: React.CSSProperties; @@ -1037,7 +1037,7 @@ declare namespace __MaterialUI { text: string; } export interface DialogProps extends React.DOMAttributes<{}>, React.Props { - actions?: Array>; + actions?: Array; /** @deprecated use a custom `actions` property instead */ actionFocus?: string; actionsContainerClassName?: string; @@ -1103,10 +1103,10 @@ declare namespace __MaterialUI { } export interface GridTileProps { - actionIcon?: React.ReactElement; + actionIcon?: React.ReactElement; actionPosition?: "left" | "right"; cols?: number; - containerElement?: string | React.ReactElement | React.ComponentClass; + containerElement?: string | React.ReactElement | React.ComponentClass; rows?: number; style?: React.CSSProperties; subtitle?: React.ReactNode; @@ -1157,9 +1157,9 @@ declare namespace __MaterialUI { initiallyOpen?: boolean; innerDivStyle?: React.CSSProperties; insetChildren?: boolean; - leftAvatar?: React.ReactElement; - leftCheckbox?: React.ReactElement; - leftIcon?: React.ReactElement; + leftAvatar?: React.ReactElement; + leftCheckbox?: React.ReactElement; + leftIcon?: React.ReactElement; nestedItems?: Array>; nestedLevel?: number; nestedListStyle?: React.CSSProperties; @@ -1172,10 +1172,10 @@ declare namespace __MaterialUI { open?: boolean; primaryText?: React.ReactNode; primaryTogglesNestedList?: boolean; - rightAvatar?: React.ReactElement; - rightIcon?: React.ReactElement; - rightIconButton?: React.ReactElement; - rightToggle?: React.ReactElement; + rightAvatar?: React.ReactElement; + rightIcon?: React.ReactElement; + rightIconButton?: React.ReactElement; + rightToggle?: React.ReactElement; secondaryText?: React.ReactNode; secondaryTextLines?: number; // 1 or 2 style?: React.CSSProperties; @@ -1227,11 +1227,11 @@ declare namespace __MaterialUI { innerDivStyle?: React.CSSProperties; insetChildren?: boolean; label?: string | React.ReactNode; - leftIcon?: React.ReactElement; + leftIcon?: React.ReactElement; menuItems?: React.ReactNode; onClick?: React.MouseEventHandler<{}>; primaryText?: React.ReactNode; - rightIcon?: React.ReactElement; + rightIcon?: React.ReactElement; secondaryText?: React.ReactNode; style?: React.CSSProperties; containerElement?: React.ReactNode | string; @@ -1503,7 +1503,7 @@ declare namespace __MaterialUI { rippleColor?: string; rippleStyle?: React.CSSProperties; style?: React.CSSProperties; - switchElement: React.ReactElement; + switchElement: React.ReactElement; switched: boolean; thumbStyle?: React.CSSProperties; trackStyle?: React.CSSProperties; diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index e2fa0ee465..d1b0a761ab 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -147,7 +147,7 @@ export interface Renderer { ): React.Component | Element | void; ( - element: Array>, + element: Array, container: Element | null, callback?: () => void ): React.Component | Element | void; diff --git a/types/mjml-react/index.d.ts b/types/mjml-react/index.d.ts index decb895010..80efb1c75d 100644 --- a/types/mjml-react/index.d.ts +++ b/types/mjml-react/index.d.ts @@ -24,7 +24,7 @@ export namespace utils { function getTextAlign(value: string, fallback?: TextAlignment): TextAlignment; } -export function renderToMjml(email: React.ReactElement): string; +export function renderToMjml(email: React.ReactElement): string; export interface Mjml2HtmlOptions { fonts?: { [key: string]: string }; @@ -35,7 +35,7 @@ export interface Mjml2HtmlOptions { filePath?: string; } -export function render(email: React.ReactElement, options?: Mjml2HtmlOptions): { html: string; errors: Error[] }; +export function render(email: React.ReactElement, options?: Mjml2HtmlOptions): { html: string; errors: Error[] }; // Components diff --git a/types/next-server/head.d.ts b/types/next-server/head.d.ts index 8a8be730f8..a4073c036b 100644 --- a/types/next-server/head.d.ts +++ b/types/next-server/head.d.ts @@ -3,6 +3,6 @@ import * as React from "react"; export function defaultHead(className?: string): JSX.Element[]; export default class Head extends React.Component { static canUseDOM: boolean; - static peek(): Array>; - static rewind(): Array>; + static peek(): Array; + static rewind(): Array; } diff --git a/types/next-server/link.d.ts b/types/next-server/link.d.ts index 520868f05f..04580e24b1 100644 --- a/types/next-server/link.d.ts +++ b/types/next-server/link.d.ts @@ -11,7 +11,7 @@ export interface LinkProps { href?: string | UrlLike; as?: string | UrlLike; passHref?: boolean; - children: React.ReactElement; + children: React.ReactElement; } export default class Link extends React.Component {} diff --git a/types/prop-types/prop-types-tests.ts b/types/prop-types/prop-types-tests.ts index baf210fdeb..5973e6a7ca 100644 --- a/types/prop-types/prop-types-tests.ts +++ b/types/prop-types/prop-types-tests.ts @@ -9,7 +9,7 @@ interface Props { any?: any; array: string[]; bool: boolean; - element: ReactElement; + element: ReactElement; func(foo: string): void; node?: ReactNode; requiredNode: NonNullable; diff --git a/types/rc-select/index.d.ts b/types/rc-select/index.d.ts index 30fc16507f..c5cfd17a75 100644 --- a/types/rc-select/index.d.ts +++ b/types/rc-select/index.d.ts @@ -74,7 +74,7 @@ declare namespace RcSelect { export class Option extends React.Component { } interface OptGroupProps { - label?: string | React.ReactElement; + label?: string | React.ReactElement; key?: string; value?: string; } diff --git a/types/react-addons-test-utils/index.d.ts b/types/react-addons-test-utils/index.d.ts index 19df32f3dc..01300f874f 100644 --- a/types/react-addons-test-utils/index.d.ts +++ b/types/react-addons-test-utils/index.d.ts @@ -70,9 +70,9 @@ declare namespace TestUtils { } export interface ShallowRenderer { - getRenderOutput>(): E; - getRenderOutput(): ReactElement; - render(element: ReactElement, context?: any): void; + getRenderOutput(): E; + getRenderOutput(): ReactElement; + render(element: ReactElement, context?: any): void; unmount(): void; } @@ -129,13 +129,13 @@ declare namespace TestUtils { mocked: MockedComponentClass, mockTagName?: string): typeof TestUtils; export function isElementOfType( - element: ReactElement, type: string): element is ReactHTMLElement; + element: ReactElement, type: string): element is ReactHTMLElement; export function isElementOfType

, T extends Element>( - element: ReactElement, type: string): element is DOMElement; + element: ReactElement, type: string): element is DOMElement; export function isElementOfType

( - element: ReactElement, type: SFC

): element is SFCElement

; + element: ReactElement, type: SFC

): element is SFCElement

; export function isElementOfType, C extends ComponentClass

>( - element: ReactElement, type: ClassType): element is CElement; + element: ReactElement, type: ClassType): element is CElement; export function isDOMComponent(instance: ReactInstance): instance is Element; export function isCompositeComponent(instance: ReactInstance): instance is Component; diff --git a/types/react-addons-transition-group/index.d.ts b/types/react-addons-transition-group/index.d.ts index 79f76bf84e..273f652c19 100644 --- a/types/react-addons-transition-group/index.d.ts +++ b/types/react-addons-transition-group/index.d.ts @@ -9,7 +9,7 @@ import { ComponentClass, TransitionGroupProps } from 'react'; declare module 'react' { export interface HTMLTransitionGroupProps extends HTMLAttributes { component?: ReactType; - childFactory?: (child: ReactElement) => ReactElement; + childFactory?: (child: ReactElement) => ReactElement; } export interface TransitionGroupProps extends HTMLTransitionGroupProps { diff --git a/types/react-beautiful-dnd/index.d.ts b/types/react-beautiful-dnd/index.d.ts index e9c63a7060..a743ce6f78 100644 --- a/types/react-beautiful-dnd/index.d.ts +++ b/types/react-beautiful-dnd/index.d.ts @@ -104,7 +104,7 @@ export interface DroppableProvidedProps { } export interface DroppableProvided { innerRef(element: HTMLElement | null): any; - placeholder?: React.ReactElement | null; + placeholder?: React.ReactElement | null; droppableProps: DroppableProvidedProps; } @@ -120,7 +120,7 @@ export interface DroppableProps { isDropDisabled?: boolean; isCombineEnabled?: boolean; direction?: 'vertical' | 'horizontal'; - children(provided: DroppableProvided, snapshot: DroppableStateSnapshot): React.ReactElement; + children(provided: DroppableProvided, snapshot: DroppableStateSnapshot): React.ReactElement; } export class Droppable extends React.Component { } @@ -174,7 +174,7 @@ export interface DraggableProvided { // will be removed after move to react 16 innerRef(element?: HTMLElement | null): any; - placeholder?: React.ReactElement | null; + placeholder?: React.ReactElement | null; } export interface DraggableStateSnapshot { @@ -203,7 +203,7 @@ export interface DraggableProps { index: number; isDragDisabled?: boolean; disableInteractiveElementBlocking?: boolean; - children(provided: DraggableProvided, snapshot: DraggableStateSnapshot): React.ReactElement; + children(provided: DraggableProvided, snapshot: DraggableStateSnapshot): React.ReactElement; type?: TypeId; } diff --git a/types/react-bootstrap-table/index.d.ts b/types/react-bootstrap-table/index.d.ts index 226bdf1606..5f2341746f 100644 --- a/types/react-bootstrap-table/index.d.ts +++ b/types/react-bootstrap-table/index.d.ts @@ -328,7 +328,7 @@ export interface BootstrapTableProps extends Props { * expandComponent is always used with expandableRow, both of props are enable * the expand row functionality on table. */ - expandComponent?(row: any): string | ReactElement; + expandComponent?(row: any): string | ReactElement; /** * Assign some alternative options for expand row feature, expandColumnOptions * only have four available property currently. @@ -430,7 +430,7 @@ export interface FooterData { * The output value from the formatter function will be used instead of the label if the formatter function is * defined. */ - formatter?(tableData: any[]): string | number | ReactElement; + formatter?(tableData: any[]): string | number | ReactElement; } export interface SelectRow { @@ -510,7 +510,7 @@ export interface SelectRow { /** * Function that returns a component to customize the display of the selection checkbox or radio button with. */ - customComponent?(props: CustomSelectProps): string | ReactElement; + customComponent?(props: CustomSelectProps): string | ReactElement; /** * Only unselect visible rows. */ @@ -620,7 +620,7 @@ export interface Options { /** * Change the text displayed on the table if data is empty. */ - noDataText?: string | ReactElement; + noDataText?: string | ReactElement; /** * If true, this hides the noDataText on the table when the tableis empty. Default is false. */ @@ -812,7 +812,7 @@ export interface Options { * `to`: Current end index * `total`: The total data volume. */ - paginationShowsTotal?: boolean | ((start: number, to: number, total: number) => string | ReactElement); + paginationShowsTotal?: boolean | ((start: number, to: number, total: number) => string | ReactElement); /** * Allows you to modify where to start counting the pages, e.g. to set the first page number to 0. * Default is 1. @@ -887,14 +887,14 @@ export interface Options { * After v3.0.0, you can custom all the components in the ToolBar also itself too. * Give a toolBar in options props and toolBar only accept a function and a JSX returned value is necessary. */ - toolBar?(props: ToolBarProps): ReactElement; + toolBar?(props: ToolBarProps): ReactElement; /** * Button group which contain the insert, drop, show only select and export CSV buttons, these button all * grouped as btn-group class in bootstrap. This is a chance that you can custom this button group. * Give a btnGroup in options props and btnGroup only accept a function and a JSX returned value is necessary. * This lets you customize just the left-hand-side of the toolbar if desired. */ - btnGroup?(props: ButtonGroupProps): ReactElement; + btnGroup?(props: ButtonGroupProps): ReactElement; /** * It's available to customize the insert button by configuring insertBtn in options props, insertBtn only * accept a function and a JSX returned value is necessary. This function will take one argument: onClick. @@ -902,7 +902,7 @@ export interface Options { * The default `InsertButton` component is also exported as a component, so that you can use it as the base * for your custom component. */ - insertBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; + insertBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; /** * It's available to customize delete button by configuring deleteBtn in options props, deleteBtn onl { * The default `DeleteButton` component is also exported as a component, so that you can use it as the base * for your custom component. */ - deleteBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; + deleteBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; /** * It's available to customize the export csv button by configuring exportCSVBtn in options props, exportCSVBtn only * accept a function and a JSX returned value is necessary. This function will take one argument: onClick. @@ -918,7 +918,7 @@ export interface Options { * The default `ExportCSVButton` component is also exported as a component, so that you can use it as the base * for your custom component. */ - exportCSVBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; + exportCSVBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; /** * It's available to custom select only toggle button by configuring showSelectedOnlyBtn in options props. * showSelectedOnlyBtn only accept a function and a JSX returned value is necessary. @@ -927,7 +927,7 @@ export interface Options { * The default `ShowSelectedOnlyButton` component is also exported as a component, so that you can use it as * the base for your custom component. */ - showSelectedOnlyBtn?(onClick: (e: React.MouseEvent) => void, showSelected: boolean): ReactElement; + showSelectedOnlyBtn?(onClick: (e: React.MouseEvent) => void, showSelected: boolean): ReactElement; /** * You can custom the whole search panel(right side) by searchPanel in options props. searchPanel only accept * a function and a JSX returned value is necessary. This function will take one argument: props, that contains: @@ -938,7 +938,7 @@ export interface Options { * `clearBtnClick`: the callback function to use when the clear search button is clicked * `search`: the callback function for triggering the search, which takes the search text as an input. */ - searchPanel?(props: SearchPanelProps): ReactElement; + searchPanel?(props: SearchPanelProps): ReactElement; /** * You can custom the search input field only by searchField in options props. searchField only accept a * function and a JSX returned value is necessary. @@ -954,7 +954,7 @@ export interface Options { * The default `ClearSearchButton` component is also exported as a component, so that you can use it as the * base for your own custom component. */ - clearSearchBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; + clearSearchBtn?(onClick: (e: React.MouseEvent) => void): ReactElement; /** * You can customize everything in the insert modal via options.insertModal and we give you the event * callback, props and some informations: onModalClose, onSave, columns, validateState, ignoreEditable @@ -966,7 +966,7 @@ export interface Options { columns: ReadonlyArray>, validateState: { [dataField: string]: string }, ignoreEditable: boolean - ): ReactElement; + ): ReactElement; /** * You can customize the body of the insert modal via options.insertModalBody and we give you the following * arguments: columns, validateState {[fieldname]: errorMsg}, ignoreEditable @@ -989,7 +989,7 @@ export interface Options { * The default `InsertModalHeader` component is also exported as a component, so that you can use it as the base * for your own custom component. */ - insertModalHeader?(closeModal: () => void, save: () => void): ReactElement; + insertModalHeader?(closeModal: () => void, save: () => void): ReactElement; /** * It's available to custom the footer of insert modal by configuring options.insertModalFooter. It only accepts * a function and a JSX returned value is necessary. This function will take two arguments: closeModal and save. @@ -999,16 +999,16 @@ export interface Options { * The default `InsertModalFooter` component is also exported as a component, so that you can use it as the base * for your own custom component. */ - insertModalFooter?(closeModal: () => void, save: () => void): ReactElement; + insertModalFooter?(closeModal: () => void, save: () => void): ReactElement; /** * Function to customize all of components for pagination, including the sizePerPage dropdown and the * pagination list. */ - paginationPanel?(props: PaginationPanelProps): ReactElement; + paginationPanel?(props: PaginationPanelProps): ReactElement; /** * Function to customize the sizePerPage dropdown. */ - sizePerPageDropDown?(props: SizePerPageFunctionProps): ReactElement; + sizePerPageDropDown?(props: SizePerPageFunctionProps): ReactElement; /** * Location for the pagination panel to be displayed. Options are 'top' (above the table), 'bottom' * (below the table) and 'both' (above and below the table). @@ -1206,13 +1206,13 @@ export interface TableHeaderColumnProps extends Props { * `direction`: the current sort order. * `fieldName`: the dataField name of the field currently being sorted. */ - caretRender?(direction: SortOrder | null, fieldName: string): string | ReactElement; + caretRender?(direction: SortOrder | null, fieldName: string): string | ReactElement; /** * To customize the column. This callback function should return a String or a React Component. * In addition, this function taking four argument: cell, row, formatExtraData, rowIdx. * The formatExtraData will be the value which you assign it on */ - dataFormat?(cell: any, row: any, formatExtraData: any, rowIndex: number): string | ReactElement; + dataFormat?(cell: any, row: any, formatExtraData: any, rowIndex: number): string | ReactElement; /** * It's useful with dataFormat, you can give any data you want to be passed to the formatter. */ @@ -1412,7 +1412,7 @@ export interface TableHeaderColumnProps extends Props { editorClass: string, ignoreEditable: boolean, defaultValue: any - ): ReactElement | boolean; + ): ReactElement | boolean; }; /** * Support specifying that the column should start sorting with the 'asc' option. @@ -1912,7 +1912,7 @@ export interface ExpandColumnOptions { /** * a callback function to customize the appearance of the indicator column. */ - expandColumnComponent?(props: ExpandColumnComponentProps): string | ReactElement; + expandColumnComponent?(props: ExpandColumnComponentProps): string | ReactElement; /** * set the width of indicator column. */ @@ -1925,7 +1925,7 @@ export interface ExpandColumnOptions { /** * a callback function to customise the header column */ - expandedColumnHeaderComponent?(props: ExpandedColumnHeaderProps): string | ReactElement; + expandedColumnHeaderComponent?(props: ExpandedColumnHeaderProps): string | ReactElement; } /** @@ -1990,7 +1990,7 @@ export interface ColumnDescription { * Column data format function. * Comes from TableHeader.dataFormat property. */ - format(cell: any, row: TRow, formatExtraData: any, rowIndex: number): string | ReactElement; + format(cell: any, row: TRow, formatExtraData: any, rowIndex: number): string | ReactElement; /** * The formatExtraData setting for the column. * Comes from TableHeader.formatExtraData property. @@ -2060,7 +2060,7 @@ export interface ColumnDescription { * Custom header value/component/children to use for this column. * Comes from TableHeader.headerText || TableHeader.children properties. */ - text: string | number | boolean | ReactElement; + text: string | number | boolean | ReactElement; /** * Custom sort function to use for this column. * Comes from TableHeader.sortFunc property. @@ -2109,19 +2109,19 @@ export interface ToolBarProps { /** * Search panel component. */ - searchPanel: ReactElement; + searchPanel: ReactElement; /** * Button group components. */ - btnGroup: ReactElement; // button groups JSX + btnGroup: ReactElement; // button groups JSX /** * The individual search field. */ - searchField: ReactElement; // search field JSX + searchField: ReactElement; // search field JSX /** * The button to clear the search field. */ - clearBtn: ReactElement; // clear search field JSX + clearBtn: ReactElement; // clear search field JSX }; /** * Event callbacks to use with a custom toolbar. @@ -2161,19 +2161,19 @@ export interface ButtonGroupProps { /** * Export to CSV button. */ - exportCSVBtn: ReactElement; + exportCSVBtn: ReactElement; /** * Insert button (to add a row). */ - insertBtn: ReactElement; + insertBtn: ReactElement; /** * Delete button. */ - deleteBtn: ReactElement; + deleteBtn: ReactElement; /** * Toggle button to switch between showing all rows and showing selected rows only. */ - showSelectedOnlyBtn: ReactElement; + showSelectedOnlyBtn: ReactElement; } /** @@ -2183,11 +2183,11 @@ export interface SearchPanelProps { /** * Default search field component. */ - searchField: ReactElement; + searchField: ReactElement; /** * Default clear search field button component. */ - clearBtn: ReactElement; + clearBtn: ReactElement; /** * The default search text. */ @@ -2247,7 +2247,7 @@ export interface PaginationPanelProps { /** * Text/element to display when displaying the total number of rows. */ - totalText: string | ReactElement; + totalText: string | ReactElement; /** * Default sizePerPageDropdown component. */ @@ -2318,7 +2318,7 @@ export interface CustomEditor { * `onUpdate`: callback function to call to update the value inside the cell. * `props`: */ - getElement(onUpdate: (updatedCell: TRow[K]) => void, props: CustomEditorProps): ReactElement; + getElement(onUpdate: (updatedCell: TRow[K]) => void, props: CustomEditorProps): ReactElement; /** * Additional parameters to pass to the getElement function inside the props argument. */ @@ -2459,7 +2459,7 @@ export interface InsertModalColumnDescription { * Header text/element for the column. * Comes from TableHeader.headerText or TableHeader.children. */ - name: string | ReactElement; + name: string | ReactElement; /** * Field name for the column data. * Comes from TableHeader.dataField. @@ -2480,7 +2480,7 @@ export interface InsertModalColumnDescription { editorClass: string, ignoreEditable: boolean, defaultValue: TRow[keyof TRow] - ): ReactElement | boolean; + ): ReactElement | boolean; /** * Flag to indicate whether this column should be hidden on the Insert Modal page. * Comes from TableHeader.hiddenOnInsert. diff --git a/types/react-bootstrap-table/v2/index.d.ts b/types/react-bootstrap-table/v2/index.d.ts index 07d7da53d9..8ea1091e16 100644 --- a/types/react-bootstrap-table/v2/index.d.ts +++ b/types/react-bootstrap-table/v2/index.d.ts @@ -291,7 +291,7 @@ export interface Options { /** * Change the displaying text on table if data is empty. */ - noDataText?: string | ReactElement; + noDataText?: string | ReactElement; /** * A delay for trigger search after a keyup (millisecond) */ @@ -433,7 +433,7 @@ export interface Options { * `rowKeys` is the row keys which been deleted, you can call next function to apply this deletion. */ handleConfirmDeleteRow?: (next: Function, rowKeys: any[]) => void; - paginationShowsTotal?: boolean | ((start: number, to: number, total: number) => string | ReactElement); + paginationShowsTotal?: boolean | ((start: number, to: number, total: number) => string | ReactElement); onSearchChange?: Function; onAddRow?: Function; onExportToCSV?: Function; @@ -557,12 +557,12 @@ export interface TableHeaderColumnProps extends Props { * getElement(REQUIRED): Accept a callback function and take two arguments: onUpdate and props. * customEditorParameters: Another extra data for custom cell edit component. */ - customEditor?: { getElement: (onUpdate: any, props: any) => ReactElement, customEditorParameters?: object }; + customEditor?: { getElement: (onUpdate: any, props: any) => ReactElement, customEditorParameters?: object }; /** * To customize the column. This callback function should return a String or a React Component. * In addition, this function taking two argument: cell and row. */ - dataFormat?: (cell: any, row: any, formatExtraData?: any) => string | ReactElement; + dataFormat?: (cell: any, row: any, formatExtraData?: any) => string | ReactElement; /** * To to enable search or filter data on formatting. Default is false */ diff --git a/types/react-bootstrap/lib/Collapse.d.ts b/types/react-bootstrap/lib/Collapse.d.ts index 5bc69f5489..64c7e27d88 100644 --- a/types/react-bootstrap/lib/Collapse.d.ts +++ b/types/react-bootstrap/lib/Collapse.d.ts @@ -4,7 +4,7 @@ import { TransitionCallbacks } from 'react-bootstrap'; declare namespace Collapse { export interface CollapseProps extends TransitionCallbacks, React.ClassAttributes { dimension?: 'height' | 'width' | { ( ):string }; - getDimensionValue?: ( dimension:number, element:React.ReactElement ) => number; + getDimensionValue?: ( dimension:number, element:React.ReactElement ) => number; in?: boolean; timeout?: number; transitionAppear?: boolean; diff --git a/types/react-bootstrap/lib/Modal.d.ts b/types/react-bootstrap/lib/Modal.d.ts index 80ffdf72f1..edbea990d9 100644 --- a/types/react-bootstrap/lib/Modal.d.ts +++ b/types/react-bootstrap/lib/Modal.d.ts @@ -31,7 +31,7 @@ declare namespace Modal { onEscapeKeyUp?: (node: HTMLElement) => any; onShow?: (node: HTMLElement) => any; show?: boolean; - transition?: React.ReactElement; + transition?: React.ReactElement; } } declare class Modal extends React.Component { diff --git a/types/react-confirm/index.d.ts b/types/react-confirm/index.d.ts index e66faaaa63..58ffe3b5d9 100644 --- a/types/react-confirm/index.d.ts +++ b/types/react-confirm/index.d.ts @@ -11,7 +11,7 @@ export function confirmable

(component: React.ComponentType, unmountDelay?: number): (props: any) => Promise; export interface ReactConfirmProps { - confirmation: string | React.ReactElement; + confirmation: string | React.ReactElement; dismiss: () => void; proceed: (value?: string) => void; cancel: (value?: string) => void; diff --git a/types/react-countup/index.d.ts b/types/react-countup/index.d.ts index cae8139054..cfbb37650c 100644 --- a/types/react-countup/index.d.ts +++ b/types/react-countup/index.d.ts @@ -58,7 +58,7 @@ declare namespace ReactCountUp { start(): void; }): void; style?: React.CSSProperties; - children?(data: RenderProps): React.ReactElement; + children?(data: RenderProps): React.ReactElement; } } diff --git a/types/react-data-grid/index.d.ts b/types/react-data-grid/index.d.ts index 94d8af72d9..440c4dec5c 100644 --- a/types/react-data-grid/index.d.ts +++ b/types/react-data-grid/index.d.ts @@ -81,17 +81,17 @@ declare namespace AdazzleReactDataGrid { * A toolbar to display above the grid. * Consider using the toolbar included in "react-data-grid/addons". */ - toolbar?: React.ReactElement + toolbar?: React.ReactElement /** * A context menu to disiplay when the user right-clicks a cell. * Consider using "react-contextmenu", included in "react-data-grid/addons". */ - contextMenu?: React.ReactElement + contextMenu?: React.ReactElement /** * A react component to customize how rows are rendered. * If you want to define your own, consider extending ReactDataGrid.Row. */ - rowRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent + rowRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * A component to display when there are no rows to render. */ @@ -328,7 +328,7 @@ declare namespace AdazzleReactDataGrid { /** * A custom formatter for this column's filter. */ - filterRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent; + filterRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent; /** * The editor for this column. Several editors are available in "react-data-grid/addons". * @default A simple text editor @@ -340,11 +340,11 @@ declare namespace AdazzleReactDataGrid { /** * A custom read-only formatter for this column. An image formatter is available in "react-data-grid/addons". */ - formatter?: React.ReactElement | React.ComponentClass | React.StatelessComponent + formatter?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * A custom formatter for this column's header. */ - headerRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent + headerRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * Events to be bound to the cells in this specific column. * Each event must respect this standard in order to work correctly: diff --git a/types/react-data-grid/v1/index.d.ts b/types/react-data-grid/v1/index.d.ts index 4db1f4042a..a48ee39fdd 100644 --- a/types/react-data-grid/v1/index.d.ts +++ b/types/react-data-grid/v1/index.d.ts @@ -62,17 +62,17 @@ declare namespace AdazzleReactDataGrid { * A toolbar to display above the grid. * Consider using the toolbar included in "react-data-grid/addons". */ - toolbar?: React.ReactElement + toolbar?: React.ReactElement /** * A context menu to disiplay when the user right-clicks a cell. * Consider using "react-contextmenu", included in "react-data-grid/addons". */ - contextMenu?: React.ReactElement + contextMenu?: React.ReactElement /** * A react component to customize how rows are rendered. * If you want to define your own, consider extending ReactDataGrid.Row. */ - rowRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent + rowRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * A component to display when there are no rows to render. */ @@ -240,15 +240,15 @@ declare namespace AdazzleReactDataGrid { * The editor for this column. Several editors are available in "react-data-grid/addons". * @default A simple text editor */ - editor?: React.ReactElement + editor?: React.ReactElement /** * A custom read-only formatter for this column. An image formatter is available in "react-data-grid/addons". */ - formatter?: React.ReactElement | React.ComponentClass | React.StatelessComponent + formatter?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * A custom formatter for this column's header. */ - headerRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent + headerRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * Events to be bound to the cells in this specific column. * Each event must respect this standard in order to work correctly: diff --git a/types/react-data-grid/v2/index.d.ts b/types/react-data-grid/v2/index.d.ts index bfa4ea979f..95b0fc9dbd 100644 --- a/types/react-data-grid/v2/index.d.ts +++ b/types/react-data-grid/v2/index.d.ts @@ -62,17 +62,17 @@ declare namespace AdazzleReactDataGrid { * A toolbar to display above the grid. * Consider using the toolbar included in "react-data-grid/addons". */ - toolbar?: React.ReactElement + toolbar?: React.ReactElement /** * A context menu to disiplay when the user right-clicks a cell. * Consider using "react-contextmenu", included in "react-data-grid/addons". */ - contextMenu?: React.ReactElement + contextMenu?: React.ReactElement /** * A react component to customize how rows are rendered. * If you want to define your own, consider extending ReactDataGrid.Row. */ - rowRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent + rowRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * A component to display when there are no rows to render. */ @@ -309,20 +309,20 @@ declare namespace AdazzleReactDataGrid { /** * A custom formatter for this column's filter. */ - filterRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent; + filterRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent; /** * The editor for this column. Several editors are available in "react-data-grid/addons". * @default A simple text editor */ - editor?: React.ReactElement | React.ComponentClass | React.StatelessComponent + editor?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * A custom read-only formatter for this column. An image formatter is available in "react-data-grid/addons". */ - formatter?: React.ReactElement | React.ComponentClass | React.StatelessComponent + formatter?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * A custom formatter for this column's header. */ - headerRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent + headerRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent /** * Events to be bound to the cells in this specific column. * Each event must respect this standard in order to work correctly: diff --git a/types/react-datagrid/index.d.ts b/types/react-datagrid/index.d.ts index 032a640daf..d194c8bf09 100644 --- a/types/react-datagrid/index.d.ts +++ b/types/react-datagrid/index.d.ts @@ -184,7 +184,7 @@ declare namespace ReactDataGrid { * or anything that React can render, so you can customize it as you * please. */ - title?: string | React.ReactElement; + title?: string | React.ReactElement; /** * Function - if you want custom rendering, specify this property. diff --git a/types/react-datagrid/react-datagrid-tests.tsx b/types/react-datagrid/react-datagrid-tests.tsx index 1505961d81..0c30475978 100644 --- a/types/react-datagrid/react-datagrid-tests.tsx +++ b/types/react-datagrid/react-datagrid-tests.tsx @@ -15,7 +15,7 @@ var sortInfo = [ { name: 'country', dir: 'asc'}] export module X { export class ExampleBasic extends React.Component { - render(): React.ReactElement { + render(): React.ReactElement { return ( { + render(): React.ReactElement { return ( | Element | void; ( - element: Array>, + element: Array, container: Element | null, callback?: () => void ): Component | Element | void; diff --git a/types/react-dom/node-stream/index.d.ts b/types/react-dom/node-stream/index.d.ts index ff24c8a939..480392aaa4 100644 --- a/types/react-dom/node-stream/index.d.ts +++ b/types/react-dom/node-stream/index.d.ts @@ -5,14 +5,14 @@ import { ReactElement } from 'react'; * server. * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostream */ -export function renderToStream(element: ReactElement): any; +export function renderToStream(element: ReactElement): any; /** * Similar to renderToStream, except this doesn't create extra DOM attributes * such as data-react-id that React uses internally. * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostaticstream */ -export function renderToStaticStream(element: ReactElement): any; +export function renderToStaticStream(element: ReactElement): any; export const version: string; export as namespace ReactDOMNodeStream; diff --git a/types/react-dom/server/index.d.ts b/types/react-dom/server/index.d.ts index ef42606717..da257248b9 100644 --- a/types/react-dom/server/index.d.ts +++ b/types/react-dom/server/index.d.ts @@ -18,14 +18,14 @@ import { ReactElement } from 'react'; * React will preserve it and only attach event handlers, allowing you * to have a very performant first-load experience. */ -export function renderToString(element: ReactElement): string; +export function renderToString(element: ReactElement): string; /** * Render a React element to its initial HTML. Returns a Readable stream that outputs * an HTML string. The HTML output by this stream is exactly equal to what * `ReactDOMServer.renderToString()` would return. */ -export function renderToNodeStream(element: ReactElement): NodeJS.ReadableStream; +export function renderToNodeStream(element: ReactElement): NodeJS.ReadableStream; /** * Similar to `renderToString`, except this doesn't create extra DOM attributes @@ -33,14 +33,14 @@ export function renderToNodeStream(element: ReactElement): NodeJS.ReadableS * to use React as a simple static page generator, as stripping away the extra * attributes can save lots of bytes. */ -export function renderToStaticMarkup(element: ReactElement): string; +export function renderToStaticMarkup(element: ReactElement): string; /** * Similar to `renderToNodeStream`, except this doesn't create extra DOM attributes * such as `data-reactid`, that React uses internally. The HTML output by this stream * is exactly equal to what `ReactDOMServer.renderToStaticMarkup()` would return. */ -export function renderToStaticNodeStream(element: ReactElement): NodeJS.ReadableStream; +export function renderToStaticNodeStream(element: ReactElement): NodeJS.ReadableStream; export const version: string; diff --git a/types/react-dom/test-utils/index.d.ts b/types/react-dom/test-utils/index.d.ts index 8730dc9447..c6f46edd36 100644 --- a/types/react-dom/test-utils/index.d.ts +++ b/types/react-dom/test-utils/index.d.ts @@ -66,15 +66,15 @@ export interface ShallowRenderer { /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput>(): E; + getRenderOutput(): E; /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput(): ReactElement; + getRenderOutput(): ReactElement; /** * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep. */ - render(element: ReactElement, context?: any): void; + render(element: ReactElement, context?: any): void; unmount(): void; } @@ -186,22 +186,22 @@ export function isElement(element: any): boolean; * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType( - element: ReactElement, type: string): element is ReactHTMLElement; + element: ReactElement, type: string): element is ReactHTMLElement; /** * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType

, T extends Element>( - element: ReactElement, type: string): element is DOMElement; + element: ReactElement, type: string): element is DOMElement; /** * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType

( - element: ReactElement, type: SFC

): element is SFCElement

; + element: ReactElement, type: SFC

): element is SFCElement

; /** * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType, C extends ComponentClass

>( - element: ReactElement, type: ClassType): element is CElement; + element: ReactElement, type: ClassType): element is CElement; /** * Returns `true` if `instance` is a DOM component (such as a `

` or ``). diff --git a/types/react-dom/v15/node-stream/index.d.ts b/types/react-dom/v15/node-stream/index.d.ts index ff24c8a939..480392aaa4 100644 --- a/types/react-dom/v15/node-stream/index.d.ts +++ b/types/react-dom/v15/node-stream/index.d.ts @@ -5,14 +5,14 @@ import { ReactElement } from 'react'; * server. * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostream */ -export function renderToStream(element: ReactElement): any; +export function renderToStream(element: ReactElement): any; /** * Similar to renderToStream, except this doesn't create extra DOM attributes * such as data-react-id that React uses internally. * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostaticstream */ -export function renderToStaticStream(element: ReactElement): any; +export function renderToStaticStream(element: ReactElement): any; export const version: string; export as namespace ReactDOMNodeStream; diff --git a/types/react-dom/v15/server/index.d.ts b/types/react-dom/v15/server/index.d.ts index 7d45ecbeee..59186f9174 100644 --- a/types/react-dom/v15/server/index.d.ts +++ b/types/react-dom/v15/server/index.d.ts @@ -10,7 +10,7 @@ import { ReactElement } from 'react'; * React will preserve it and only attach event handlers, allowing you * to have a very performant first-load experience. */ -export function renderToString(element: ReactElement): string; +export function renderToString(element: ReactElement): string; /** * Similar to `renderToString`, except this doesn't create extra DOM attributes @@ -18,7 +18,7 @@ export function renderToString(element: ReactElement): string; * to use React as a simple static page generator, as stripping away the extra * attributes can save lots of bytes. */ -export function renderToStaticMarkup(element: ReactElement): string; +export function renderToStaticMarkup(element: ReactElement): string; export const version: string; export as namespace ReactDOMServer; diff --git a/types/react-dom/v15/test-utils/index.d.ts b/types/react-dom/v15/test-utils/index.d.ts index 05362460d4..3daa6325ae 100644 --- a/types/react-dom/v15/test-utils/index.d.ts +++ b/types/react-dom/v15/test-utils/index.d.ts @@ -66,15 +66,15 @@ export interface ShallowRenderer { /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput>(): E; + getRenderOutput(): E; /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput(): ReactElement; + getRenderOutput(): ReactElement; /** * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep. */ - render(element: ReactElement, context?: any): void; + render(element: ReactElement, context?: any): void; unmount(): void; } @@ -182,22 +182,22 @@ export function isElement(element: any): boolean; * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType( - element: ReactElement, type: string): element is ReactHTMLElement; + element: ReactElement, type: string): element is ReactHTMLElement; /** * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType

, T extends Element>( - element: ReactElement, type: string): element is DOMElement; + element: ReactElement, type: string): element is DOMElement; /** * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType

( - element: ReactElement, type: SFC

): element is SFCElement

; + element: ReactElement, type: SFC

): element is SFCElement

; /** * Returns `true` if `element` is a React element whose type is of a React `componentClass`. */ export function isElementOfType, C extends ComponentClass

>( - element: ReactElement, type: ClassType): element is CElement; + element: ReactElement, type: ClassType): element is CElement; /** * Returns `true` if `instance` is a DOM component (such as a `

` or ``). diff --git a/types/react-faux-dom/index.d.ts b/types/react-faux-dom/index.d.ts index 5c68b4ad39..eb3c52851b 100644 --- a/types/react-faux-dom/index.d.ts +++ b/types/react-faux-dom/index.d.ts @@ -14,7 +14,7 @@ export class Element extends HTMLElement { constructor(nodeName: string, parentNode?: Element); - toReact(): React.ReactElement; + toReact(): React.ReactElement; } export const defaultView: { diff --git a/types/react-form/v1/index.d.ts b/types/react-form/v1/index.d.ts index 0d4bdc6300..77a58834a1 100644 --- a/types/react-form/v1/index.d.ts +++ b/types/react-form/v1/index.d.ts @@ -121,7 +121,7 @@ export interface FormFieldApi { export interface FormFieldPropsWithField { field?: string; - children(api: FormFieldApi): React.ReactElement | null; + children(api: FormFieldApi): React.ReactElement | null; } export interface FormFieldPropsWithoutField { children(api: FormApi): RenderReturn; @@ -147,7 +147,7 @@ export interface FormInputProps { } export interface FormInputPropsWithChildren extends FormInputProps { - children(api: FormFieldApi): React.ReactElement | null; + children(api: FormFieldApi): React.ReactElement | null; } export const FormInput: React.SFC; diff --git a/types/react-hyperscript/index.d.ts b/types/react-hyperscript/index.d.ts index ee953d3892..c5fb5ae4e1 100644 --- a/types/react-hyperscript/index.d.ts +++ b/types/react-hyperscript/index.d.ts @@ -8,12 +8,12 @@ import { ComponentClass, StatelessComponent, ReactElement } from 'react'; declare namespace h {} -type Element = ReactElement | string | number | null; +type Element = ReactElement | string | number | null; declare function h( componentOrTag: ComponentClass | StatelessComponent | string, children?: ReadonlyArray | Element -): ReactElement; +): ReactElement; declare function h

( componentOrTag: ComponentClass

| StatelessComponent

| string, diff --git a/types/react-image-fallback/index.d.ts b/types/react-image-fallback/index.d.ts index 4fcf2c20cd..111afeedf0 100644 --- a/types/react-image-fallback/index.d.ts +++ b/types/react-image-fallback/index.d.ts @@ -17,8 +17,8 @@ export default class ReactImageFallback extends React.Component< export interface ReactImageFallbackProps { src: string; - fallbackImage: string | React.ReactElement | string[] | Array>; - initialImage?: string | React.ReactElement; + fallbackImage: string | React.ReactElement | string[] | Array; + initialImage?: string | React.ReactElement; onLoad?: (event: React.SyntheticEvent) => void; onError?: (event: React.SyntheticEvent) => void; initialTimeout?: number; diff --git a/types/react-imageloader/index.d.ts b/types/react-imageloader/index.d.ts index 6e569b1410..051167987a 100644 --- a/types/react-imageloader/index.d.ts +++ b/types/react-imageloader/index.d.ts @@ -21,7 +21,7 @@ declare module "react-imageloader" { onLoad?: (event: any) => void; /** An optional function that returns a React element to be shown while the image loads. */ - preloader?: (params: any) => React.ReactElement; + preloader?: (params: any) => React.ReactElement; /** The URL of the image to be loaded. */ src: string; @@ -30,7 +30,7 @@ declare module "react-imageloader" { style?: React.CSSProperties; /** A function that takes a props argument and returns a React element to be used as the wrapper component. Defaults to React.DOM.span. */ - wrapper?: (props: any) => React.ReactElement; + wrapper?: (props: any) => React.ReactElement; } class ImageLoader extends React.Component {} diff --git a/types/react-images/index.d.ts b/types/react-images/index.d.ts index 4f3e1c8893..e477231609 100644 --- a/types/react-images/index.d.ts +++ b/types/react-images/index.d.ts @@ -64,7 +64,7 @@ export interface LightboxProps { /** * Spinner component. */ - spinner?: () => React.ReactElement; + spinner?: () => React.ReactElement; /** * Color of spinner. Default value: 'white' diff --git a/types/react-infinite-scroller/index.d.ts b/types/react-infinite-scroller/index.d.ts index f0af24ac5e..eff6d71ef5 100644 --- a/types/react-infinite-scroller/index.d.ts +++ b/types/react-infinite-scroller/index.d.ts @@ -62,7 +62,7 @@ declare namespace InfiniteScroll { /** * Loader component for indicating "loading more". */ - loader?: React.ReactElement; + loader?: React.ReactElement; /** * Override method to return a different scroll listener if it's not the immediate parent of InfiniteScroll. */ diff --git a/types/react-infinite/index.d.ts b/types/react-infinite/index.d.ts index e2149a8016..32ff6e6863 100644 --- a/types/react-infinite/index.d.ts +++ b/types/react-infinite/index.d.ts @@ -17,11 +17,11 @@ declare namespace Infinite { containerHeight?: number; preloadBatchSize?: number | Object; preloadAdditionalHeight?: number | Object; - handleScroll?: (node: React.ReactElement) => void; + handleScroll?: (node: React.ReactElement) => void; infiniteLoadBeginBottomOffset?: number; infiniteLoadBeginEdgeOffset?: number; onInfiniteLoad?: () => void; - loadingSpinnerDelegate?: React.ReactElement; + loadingSpinnerDelegate?: React.ReactElement; isInfiniteLoading?: boolean; timeScrollStateLastsForAfterUserScrolls?: number; className?: string; diff --git a/types/react-infinite/react-infinite-tests.tsx b/types/react-infinite/react-infinite-tests.tsx index 6f51b95d1a..30ced4f1ba 100644 --- a/types/react-infinite/react-infinite-tests.tsx +++ b/types/react-infinite/react-infinite-tests.tsx @@ -72,14 +72,14 @@ class ListItem extends React.Component<{ key: number; num: number }, {}> { } } -class InfiniteList extends React.Component<{}, { elements: React.ReactElement[], isInfiniteLoading: boolean }> { +class InfiniteList extends React.Component<{}, { elements: React.ReactElement[], isInfiniteLoading: boolean }> { state = { elements: this.buildElements(0, 20), isInfiniteLoading: false }; buildElements(start: number, end: number) { - var elements = [] as React.ReactElement[]; + var elements = [] as React.ReactElement[]; for (var i = start; i < end; i++) { elements.push() } diff --git a/types/react-instantsearch-native/react-instantsearch-native-tests.tsx b/types/react-instantsearch-native/react-instantsearch-native-tests.tsx index 7a369b0487..fa3b4b594d 100644 --- a/types/react-instantsearch-native/react-instantsearch-native-tests.tsx +++ b/types/react-instantsearch-native/react-instantsearch-native-tests.tsx @@ -42,7 +42,7 @@ const App = () => ( const IndexResults = connectStateResults( ({ searchState, searchResults, children }) => searchResults && searchResults.nbHits !== 0 ? ( - children as React.ReactElement + children as React.ReactElement ) : (

No results has been found for {searchState.query} and index{' '} @@ -64,6 +64,6 @@ const AllResults = connectStateResults(({ allSearchResults, children }) => {
) : ( - children as React.ReactElement + children as React.ReactElement ); }); diff --git a/types/react-instantsearch/react-instantsearch-tests.tsx b/types/react-instantsearch/react-instantsearch-tests.tsx index 9abf91c0ef..33f362b272 100644 --- a/types/react-instantsearch/react-instantsearch-tests.tsx +++ b/types/react-instantsearch/react-instantsearch-tests.tsx @@ -298,7 +298,7 @@ import { createInstantSearch } from "react-instantsearch-core"; const IndexResults = connectStateResults( ({ searchState, searchResults, children }) => searchResults && searchResults.nbHits !== 0 ? ( - children as React.ReactElement + children as React.ReactElement ) : (
No results has been found for {searchState.query} and index{' '} @@ -320,7 +320,7 @@ import { createInstantSearch } from "react-instantsearch-core";
) : ( - children as React.ReactElement + children as React.ReactElement ); }); }; diff --git a/types/react-is/index.d.ts b/types/react-is/index.d.ts index 962d3e1a13..3f33f40f9c 100644 --- a/types/react-is/index.d.ts +++ b/types/react-is/index.d.ts @@ -17,18 +17,18 @@ import { export function typeOf(value: any): symbol | undefined; export function isValidElementType(value: any): value is ReactType; -export function isAsyncMode(value: any): value is ReactElement; -export function isContextConsumer(value: any): value is ReactElement; -export function isContextProvider(value: any): value is ReactElement; -export function isElement(value: any): value is ReactElement; -export function isForwardRef(value: any): value is ReactElement; -export function isFragment(value: any): value is ReactElement; +export function isAsyncMode(value: any): value is ReactElement; +export function isContextConsumer(value: any): value is ReactElement; +export function isContextProvider(value: any): value is ReactElement; +export function isElement(value: any): value is ReactElement; +export function isForwardRef(value: any): value is ReactElement; +export function isFragment(value: any): value is ReactElement; export function isLazy(value: any): value is LazyExoticComponent; export function isMemo(value: any): value is MemoExoticComponent; -export function isProfiler(value: any): value is ReactElement; -export function isPortal(value: any): value is ReactElement; -export function isStrictMode(value: any): value is ReactElement; -export function isSuspense(value: any): value is ReactElement; +export function isProfiler(value: any): value is ReactElement; +export function isPortal(value: any): value is ReactElement; +export function isStrictMode(value: any): value is ReactElement; +export function isSuspense(value: any): value is ReactElement; export const AsyncMode: symbol; export const ContextConsumer: symbol; diff --git a/types/react-js-pagination/index.d.ts b/types/react-js-pagination/index.d.ts index 00f1b26a64..ee2be831e2 100644 --- a/types/react-js-pagination/index.d.ts +++ b/types/react-js-pagination/index.d.ts @@ -12,10 +12,10 @@ export interface ReactJsPaginationProps { activePage: number; itemsCountPerPage?: number; pageRangeDisplayed?: number; - prevPageText?: string| React.ReactElement; - nextPageText?: string | React.ReactElement; - lastPageText?: string | React.ReactElement; - firstPageText?: string | React.ReactElement; + prevPageText?: string| React.ReactElement; + nextPageText?: string | React.ReactElement; + lastPageText?: string | React.ReactElement; + firstPageText?: string | React.ReactElement; disabledClass?: string; hideDisabled?: boolean; hideNavigation?: boolean; diff --git a/types/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index b860fa3cd4..403356a89a 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -123,12 +123,12 @@ declare module "react-jsonschema-form" { id: string; classNames: string; label: string; - description: React.ReactElement; + description: React.ReactElement; rawDescription: string; - children: React.ReactElement; - errors: React.ReactElement; + children: React.ReactElement; + errors: React.ReactElement; rawErrors: string[]; - help: React.ReactElement; + help: React.ReactElement; rawHelp: string; hidden: boolean; required: boolean; @@ -142,14 +142,14 @@ declare module "react-jsonschema-form" { }; export type ArrayFieldTemplateProps = { - DescriptionField: React.StatelessComponent<{ id: string, description: string | React.ReactElement }>; + DescriptionField: React.StatelessComponent<{ id: string, description: string | React.ReactElement }>; TitleField: React.StatelessComponent<{ id: string, title: string, required: boolean }>; canAdd: boolean; className: string; disabled: boolean; idSchema: IdSchema; items: { - children: React.ReactElement; + children: React.ReactElement; className: string; disabled: boolean; hasMoveDown: boolean; @@ -175,12 +175,12 @@ declare module "react-jsonschema-form" { }; export type ObjectFieldTemplateProps = { - DescriptionField: React.StatelessComponent<{ id: string, description: string | React.ReactElement }>; + DescriptionField: React.StatelessComponent<{ id: string, description: string | React.ReactElement }>; TitleField: React.StatelessComponent<{ id: string, title: string, required: boolean }>; title: string; description: string; properties: { - content: React.ReactElement; + content: React.ReactElement; name: string; disabled: boolean; readonly: boolean; diff --git a/types/react-jss/lib/injectSheet.d.ts b/types/react-jss/lib/injectSheet.d.ts index ef6bdb3dbb..d165ee7e6d 100644 --- a/types/react-jss/lib/injectSheet.d.ts +++ b/types/react-jss/lib/injectSheet.d.ts @@ -41,7 +41,7 @@ export type Overwrite = Omit & U; */ export type PropsOf = C extends new (props: infer P) => React.Component ? P - : C extends (props: infer P) => React.ReactElement | null ? P : never; + : C extends (props: infer P) => React.ReactElement | null ? P : never; /** * a function that takes {component} and returns a component that passes along diff --git a/types/react-jss/react-jss-tests.tsx b/types/react-jss/react-jss-tests.tsx index 0ba2ee3d8b..5fe76ae1cb 100644 --- a/types/react-jss/react-jss-tests.tsx +++ b/types/react-jss/react-jss-tests.tsx @@ -77,7 +77,7 @@ const App = () => ( ); function ssrRender(req: any, res: { send: (text: string) => any }) { - const mockedRenderToString = (e: React.ReactElement) => `${e}`; + const mockedRenderToString = (e: React.ReactElement) => `${e}`; const sheets = new SheetsRegistry(); const body = mockedRenderToString( diff --git a/types/react-motion-loop/index.d.ts b/types/react-motion-loop/index.d.ts index acb7910911..cee48f3fae 100644 --- a/types/react-motion-loop/index.d.ts +++ b/types/react-motion-loop/index.d.ts @@ -10,7 +10,7 @@ import { MotionProps, PlainStyle, Style } from "react-motion"; interface ReactMotionLoopProps extends Partial { styleFrom: Style; styleTo: Style; - children?: (interpolatedStyle: PlainStyle) => ReactElement; + children?: (interpolatedStyle: PlainStyle) => ReactElement; } export class ReactMotionLoop extends Component {} diff --git a/types/react-motion-ui-pack/index.d.ts b/types/react-motion-ui-pack/index.d.ts index 477cf0e604..8557d50248 100644 --- a/types/react-motion-ui-pack/index.d.ts +++ b/types/react-motion-ui-pack/index.d.ts @@ -9,7 +9,7 @@ import * as motion from 'react-motion'; declare namespace Transition { interface TransitionProps { - component?: string | boolean | React.ReactElement; + component?: string | boolean | React.ReactElement; runOnMount?: boolean; appear?: motion.Style; enter?: motion.Style; diff --git a/types/react-motion/index.d.ts b/types/react-motion/index.d.ts index 761c8e559f..cf5ef94250 100644 --- a/types/react-motion/index.d.ts +++ b/types/react-motion/index.d.ts @@ -65,7 +65,7 @@ interface MotionProps { * Callback with your interpolated styles. Must return one react element to render * @param interpolatedStyle */ - children?: (interpolatedStyle: PlainStyle) => ReactElement; + children?: (interpolatedStyle: PlainStyle) => ReactElement; /** * The callback that fires when the animation comes to a rest. */ @@ -113,7 +113,7 @@ interface TransitionProps { * */ styles: Array | InterpolateFunction; - children?: (interpolatedStyles: Array) => ReactElement; + children?: (interpolatedStyles: Array) => ReactElement; /** * Triggers when a new element will appear * @param styleThatEntered diff --git a/types/react-native-draggable-flatlist/index.d.ts b/types/react-native-draggable-flatlist/index.d.ts index 0b96f0b3cd..ff97ca9f18 100644 --- a/types/react-native-draggable-flatlist/index.d.ts +++ b/types/react-native-draggable-flatlist/index.d.ts @@ -49,7 +49,7 @@ interface DraggableFlatListProps extends VirtualizedListWithoutRenderItemP /** * Function that calls move when the row should become active (in an onPress, onLongPress, etc). Calls moveEnd when the gesture is complete (in onPressOut). */ - renderItem: (info: RenderItemInfo) => React.ReactElement | null; + renderItem: (info: RenderItemInfo) => React.ReactElement | null; } declare class DraggableFlatList extends Component> { diff --git a/types/react-native-material-ui/index.d.ts b/types/react-native-material-ui/index.d.ts index b215820f2b..f2257a086b 100644 --- a/types/react-native-material-ui/index.d.ts +++ b/types/react-native-material-ui/index.d.ts @@ -762,11 +762,11 @@ export interface ThemeProps { export interface ThemeProviderProps { value: {}; - children: React.ReactElement; + children: React.ReactElement; } export interface ThemeConsumerProps { - children(props: ThemeProps): React.ReactElement; + children(props: ThemeProps): React.ReactElement; } export namespace ThemeContext { diff --git a/types/react-native-navbar/index.d.ts b/types/react-native-navbar/index.d.ts index afcd7df3ed..afdd972ddc 100644 --- a/types/react-native-navbar/index.d.ts +++ b/types/react-native-navbar/index.d.ts @@ -33,9 +33,9 @@ export interface NavigationBarProps { style?: ViewStyle; tintColor?: string; statusBar?: StatusBar; - leftButton?: NavigationBarButton | React.ReactElement | null; - rightButton?: NavigationBarButton | React.ReactElement | null; - title?: NavigationBarTitle | React.ReactElement | null; + leftButton?: NavigationBarButton | React.ReactElement | null; + rightButton?: NavigationBarButton | React.ReactElement | null; + title?: NavigationBarTitle | React.ReactElement | null; } export default class NavigationBar extends React.Component {} diff --git a/types/react-native-photo-view/index.d.ts b/types/react-native-photo-view/index.d.ts index c104b1c0e5..c3e49dcf09 100644 --- a/types/react-native-photo-view/index.d.ts +++ b/types/react-native-photo-view/index.d.ts @@ -22,9 +22,9 @@ export interface ReactNativePhotoViewProps { onLoad?: () => void; onLoadEnd?: () => void; onProgress?: (loaded: number, total: number) => void; - onTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; - onViewTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; - onScale?: (scale: number, target?: React.ReactElement) => void; + onTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; + onViewTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; + onScale?: (scale: number, target?: React.ReactElement) => void; } export default class ReactNativePhotoView extends React.Component {} diff --git a/types/react-native-photo-view/react-native-photo-view-tests.tsx b/types/react-native-photo-view/react-native-photo-view-tests.tsx index f83168d280..0bd2697630 100644 --- a/types/react-native-photo-view/react-native-photo-view-tests.tsx +++ b/types/react-native-photo-view/react-native-photo-view-tests.tsx @@ -25,13 +25,13 @@ const test: React.SFC = () => ( onProgress={(loaded: number, total: number) => { console.log(`onProgress ${loaded}/${total}`); }} - onTap={(point: {x: number; y: number}, target?: React.ReactElement) => { + onTap={(point: {x: number; y: number}, target?: React.ReactElement) => { console.log('onTap'); }} - onViewTap={(point: {x: number; y: number}, target?: React.ReactElement) => { + onViewTap={(point: {x: number; y: number}, target?: React.ReactElement) => { console.log(`onViewTap ${point.x},${point.y} ${!!target ? 'targetted' : ''}`); }} - onScale={(scale: number, target?: React.ReactElement) => { + onScale={(scale: number, target?: React.ReactElement) => { console.log(`onScale ${scale} ${!!target ? 'targetted' : ''}`); }} /> diff --git a/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx b/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx index 8e99cc95dc..1a085f91cc 100644 --- a/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx +++ b/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx @@ -23,7 +23,7 @@ class SnapCarouselTest extends React.Component { ); } - render(): React.ReactElement { + render(): React.ReactElement { return ( { + render(): React.ReactElement { return ( { + render(): React.ReactElement { return ( { console.log(this.callback.name, event, state, context); } - render(): React.ReactElement { + render(): React.ReactElement { return ( { }; } -export type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; +export type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; export interface FlatListProps extends VirtualizedListProps { /** @@ -3930,17 +3930,17 @@ export interface FlatListProps extends VirtualizedListProps { /** * Rendered when the list is empty. */ - ListEmptyComponent?: React.ComponentType | React.ReactElement | null; + ListEmptyComponent?: React.ComponentType | React.ReactElement | null; /** * Rendered at the very end of the list. */ - ListFooterComponent?: React.ComponentType | React.ReactElement | null; + ListFooterComponent?: React.ComponentType | React.ReactElement | null; /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentType | React.ReactElement | null; + ListHeaderComponent?: React.ComponentType | React.ReactElement | null; /** * Optional custom style for multi-item rows generated when numColumns > 1 @@ -4146,7 +4146,7 @@ export interface SectionListRenderItemInfo extends ListRenderItemInfo; } -export type SectionListRenderItem = (info: SectionListRenderItemInfo) => React.ReactElement | null; +export type SectionListRenderItem = (info: SectionListRenderItemInfo) => React.ReactElement | null; export interface SectionListProps extends VirtualizedListWithoutRenderItemProps { /** @@ -4157,22 +4157,22 @@ export interface SectionListProps extends VirtualizedListWithoutRenderIte /** * Rendered when the list is empty. */ - ListEmptyComponent?: React.ComponentType | React.ReactElement | null; + ListEmptyComponent?: React.ComponentType | React.ReactElement | null; /** * Rendered at the very end of the list. */ - ListFooterComponent?: React.ComponentType | React.ReactElement | null; + ListFooterComponent?: React.ComponentType | React.ReactElement | null; /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentType | React.ReactElement | null; + ListHeaderComponent?: React.ComponentType | React.ReactElement | null; /** * Rendered in between each section. */ - SectionSeparatorComponent?: React.ComponentType | React.ReactElement | null; + SectionSeparatorComponent?: React.ComponentType | React.ReactElement | null; /** * A marker property for telling the list to re-render (since it implements PureComponent). @@ -4258,12 +4258,12 @@ export interface SectionListProps extends VirtualizedListWithoutRenderIte /** * Rendered at the top of each section. Sticky headers are not yet supported. */ - renderSectionHeader?: (info: { section: SectionListData }) => React.ReactElement | null; + renderSectionHeader?: (info: { section: SectionListData }) => React.ReactElement | null; /** * Rendered at the bottom of each section. */ - renderSectionFooter?: (info: { section: SectionListData }) => React.ReactElement | null; + renderSectionFooter?: (info: { section: SectionListData }) => React.ReactElement | null; /** * An array of objects with data for each section. @@ -4323,19 +4323,19 @@ export interface VirtualizedListWithoutRenderItemProps extends ScrollView * Rendered when the list is empty. Can be a React Component Class, a render function, or * a rendered element. */ - ListEmptyComponent?: React.ComponentType | React.ReactElement | null; + ListEmptyComponent?: React.ComponentType | React.ReactElement | null; /** * Rendered at the bottom of all the items. Can be a React Component Class, a render function, or * a rendered element. */ - ListFooterComponent?: React.ComponentType | React.ReactElement | null; + ListFooterComponent?: React.ComponentType | React.ReactElement | null; /** * Rendered at the top of all the items. Can be a React Component Class, a render function, or * a rendered element. */ - ListHeaderComponent?: React.ComponentType | React.ReactElement | null; + ListHeaderComponent?: React.ComponentType | React.ReactElement | null; /** * The default accessor functions assume this is an Array<{key: string}> but you can override @@ -4560,7 +4560,7 @@ export interface ListViewProps extends ScrollViewProps { * in StaticContainer or other mechanism as appropriate. Footer is always * at the bottom of the list, and header at the top, on every render pass. */ - renderFooter?: () => React.ReactElement; + renderFooter?: () => React.ReactElement; /** * () => renderable @@ -4570,7 +4570,7 @@ export interface ListViewProps extends ScrollViewProps { * in StaticContainer or other mechanism as appropriate. Footer is always * at the bottom of the list, and header at the top, on every render pass. */ - renderHeader?: () => React.ReactElement; + renderHeader?: () => React.ReactElement; /** * (rowData, sectionID, rowID) => renderable @@ -4584,7 +4584,7 @@ export interface ListViewProps extends ScrollViewProps { sectionID: string | number, rowID: string | number, highlightRow?: boolean - ) => React.ReactElement; + ) => React.ReactElement; /** * A function that returns the scrollable component in which the list rows are rendered. @@ -4601,7 +4601,7 @@ export interface ListViewProps extends ScrollViewProps { * stick to the top until it is pushed off the screen by the next section * header. */ - renderSectionHeader?: (sectionData: any, sectionId: string | number) => React.ReactElement; + renderSectionHeader?: (sectionData: any, sectionId: string | number) => React.ReactElement; /** * (sectionID, rowID, adjacentRowHighlighted) => renderable @@ -4613,7 +4613,7 @@ export interface ListViewProps extends ScrollViewProps { sectionID: string | number, rowID: string | number, adjacentRowHighlighted?: boolean - ) => React.ReactElement; + ) => React.ReactElement; /** * How early to start rendering rows before they come on screen, in @@ -4690,12 +4690,12 @@ export interface MapViewAnnotation { onBlur?: () => any; title?: string; subtitle?: string; - leftCalloutView?: React.ReactElement; - rightCalloutView?: React.ReactElement; - detailCalloutView?: React.ReactElement; + leftCalloutView?: React.ReactElement; + rightCalloutView?: React.ReactElement; + detailCalloutView?: React.ReactElement; tintColor?: string; image?: ImageURISource; - view?: React.ReactElement; + view?: React.ReactElement; hasLeftCallout?: boolean; hasRightCallout?: boolean; onLeftCalloutPress?: () => void; @@ -4854,7 +4854,7 @@ export class MapView extends MapViewBase { } interface MaskedViewIOSProps extends ViewProps { - maskElement: React.ReactElement; + maskElement: React.ReactElement; } /** @@ -6639,10 +6639,10 @@ export interface SwipeableListViewProps { sectionID: string | number, rowID: string | number, highlightRow?: boolean - ) => React.ReactElement; + ) => React.ReactElement; // Callback method to render the view that will be unveiled on swipe - renderQuickActions(rowData: any, sectionID: string | number, rowID: string | number): React.ReactElement; + renderQuickActions(rowData: any, sectionID: string | number, rowID: string | number): React.ReactElement; } /** @@ -8185,7 +8185,7 @@ export interface UIManagerStatic { * @platform ios */ takeSnapshot: ( - view?: "window" | React.ReactElement | number, + view?: "window" | React.ReactElement | number, options?: { width?: number; height?: number; diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index e2e97c9d86..df678c4ed9 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -427,24 +427,24 @@ export interface NavigationSwitchRouterConfig { export interface NavigationStackScreenOptions { title?: string; header?: - | React.ReactElement - | ((headerProps: HeaderProps) => React.ReactElement) + | React.ReactElement + | ((headerProps: HeaderProps) => React.ReactElement) | null; headerTransparent?: boolean; - headerTitle?: string | React.ReactElement; + headerTitle?: string | React.ReactElement; headerTitleStyle?: StyleProp; headerTitleAllowFontScaling?: boolean; headerTintColor?: string; headerLeft?: - | React.ReactElement - | ((backButtonProps: HeaderBackButtonProps) => React.ReactElement) + | React.ReactElement + | ((backButtonProps: HeaderBackButtonProps) => React.ReactElement) | null; headerBackTitle?: string | null; - headerBackImage?: React.ReactElement; + headerBackImage?: React.ReactElement; headerTruncatedBackTitle?: string; headerBackTitleStyle?: StyleProp; headerPressColorAndroid?: string; - headerRight?: React.ReactElement | null; + headerRight?: React.ReactElement | null; headerStyle?: StyleProp; headerForceInset?: HeaderForceInset; headerBackground?: React.ReactNode | React.ReactType; @@ -539,16 +539,16 @@ export interface TabScene { interface NavigationTabScreenOptionsBase { title?: string; tabBarIcon?: - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean; horizontal: boolean } - ) => React.ReactElement | null); + ) => React.ReactElement | null); tabBarLabel?: | string - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | string | null); + ) => React.ReactElement | string | null); tabBarVisible?: boolean; tabBarTestIDProps?: { testID?: string; accessibilityLabel?: string }; } @@ -578,16 +578,16 @@ export type DrawerLockMode = 'unlocked' | 'locked-closed' | 'locked-open'; export interface NavigationDrawerScreenOptions { title?: string; drawerIcon?: - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | null); + ) => React.ReactElement | null); drawerLabel?: | string - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | null); + ) => React.ReactElement | null); drawerLockMode?: DrawerLockMode; } @@ -804,7 +804,7 @@ export type NavigationAnimationSetter = ( lastState: NavigationState ) => void; -export type NavigationSceneRenderer = () => React.ReactElement | null; +export type NavigationSceneRenderer = () => React.ReactElement | null; export type NavigationStyleInterpolator = ( props: NavigationSceneRendererProps @@ -1061,7 +1061,7 @@ export interface TabBarTopProps { jumpToIndex: (index: number) => void; } ) => void; - renderIcon: (scene: TabScene) => React.ReactElement; + renderIcon: (scene: TabScene) => React.ReactElement; labelStyle?: TextStyle; iconStyle?: ViewStyle; } diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 3409bbd32d..d30714fadb 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -436,7 +436,7 @@ class CustomTransitioner extends React.Component /> ); } - _render = (props: NavigationTransitionProps, prevProps?: NavigationTransitionProps): React.ReactElement => { + _render = (props: NavigationTransitionProps, prevProps?: NavigationTransitionProps): React.ReactElement => { return ( ); diff --git a/types/react-navigation/v1/index.d.ts b/types/react-navigation/v1/index.d.ts index 8e7940c6ce..1994547d57 100644 --- a/types/react-navigation/v1/index.d.ts +++ b/types/react-navigation/v1/index.d.ts @@ -289,17 +289,17 @@ export interface NavigationStackViewConfig { export interface NavigationStackScreenOptions { title?: string; - header?: (React.ReactElement | ((headerProps: HeaderProps) => React.ReactElement)) | null; + header?: (React.ReactElement | ((headerProps: HeaderProps) => React.ReactElement)) | null; headerTransparent?: boolean; - headerTitle?: string | React.ReactElement; + headerTitle?: string | React.ReactElement; headerTitleStyle?: StyleProp; headerTintColor?: string; - headerLeft?: React.ReactElement; + headerLeft?: React.ReactElement; headerBackTitle?: string | null; headerTruncatedBackTitle?: string; headerBackTitleStyle?: StyleProp; headerPressColorAndroid?: string; - headerRight?: React.ReactElement; + headerRight?: React.ReactElement; headerStyle?: StyleProp; headerBackground?: React.ReactNode | React.ReactType; gesturesEnabled?: boolean; @@ -367,13 +367,13 @@ export interface TabScene { export interface NavigationTabScreenOptions { title?: string; tabBarIcon?: - React.ReactElement + React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< any > | null)); tabBarLabel?: string - | React.ReactElement + | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< any > | string | null)); @@ -388,13 +388,13 @@ export interface NavigationTabScreenOptions { export interface NavigationDrawerScreenOptions { title?: string; drawerIcon?: - React.ReactElement + React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< any > | null)); drawerLabel?: string - | React.ReactElement + | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< any > | null)); @@ -557,7 +557,7 @@ export type NavigationAnimationSetter = ( lastState: NavigationState ) => void; -export type NavigationSceneRenderer = () => (React.ReactElement | null); +export type NavigationSceneRenderer = () => (React.ReactElement | null); export type NavigationStyleInterpolator = ( props: NavigationSceneRendererProps @@ -737,7 +737,7 @@ export interface TabBarTopProps { scene: TabScene, jumpToIndex: (index: number) => void, }) => void; - renderIcon: (scene: TabScene) => React.ReactElement; + renderIcon: (scene: TabScene) => React.ReactElement; labelStyle?: TextStyle; iconStyle?: ViewStyle; } diff --git a/types/react-navigation/v1/react-navigation-tests.tsx b/types/react-navigation/v1/react-navigation-tests.tsx index b00b0a27fc..4bd46327e3 100644 --- a/types/react-navigation/v1/react-navigation-tests.tsx +++ b/types/react-navigation/v1/react-navigation-tests.tsx @@ -366,7 +366,7 @@ class CustomTransitioner extends React.Component /> ); } - _render = (props: NavigationTransitionProps, prevProps: NavigationTransitionProps): React.ReactElement => { + _render = (props: NavigationTransitionProps, prevProps: NavigationTransitionProps): React.ReactElement => { return ( ); diff --git a/types/react-navigation/v2/index.d.ts b/types/react-navigation/v2/index.d.ts index 85b42444b1..d17a8324fa 100644 --- a/types/react-navigation/v2/index.d.ts +++ b/types/react-navigation/v2/index.d.ts @@ -425,24 +425,24 @@ export interface NavigationSwitchRouterConfig { export interface NavigationStackScreenOptions { title?: string; header?: - | React.ReactElement - | ((headerProps: HeaderProps) => React.ReactElement) + | React.ReactElement + | ((headerProps: HeaderProps) => React.ReactElement) | null; headerTransparent?: boolean; - headerTitle?: string | React.ReactElement; + headerTitle?: string | React.ReactElement; headerTitleStyle?: StyleProp; headerTitleAllowFontScaling?: boolean; headerTintColor?: string; headerLeft?: - | React.ReactElement - | ((backButtonProps: HeaderBackButtonProps) => React.ReactElement) + | React.ReactElement + | ((backButtonProps: HeaderBackButtonProps) => React.ReactElement) | null; headerBackTitle?: string | null; - headerBackImage?: React.ReactElement; + headerBackImage?: React.ReactElement; headerTruncatedBackTitle?: string; headerBackTitleStyle?: StyleProp; headerPressColorAndroid?: string; - headerRight?: React.ReactElement | null; + headerRight?: React.ReactElement | null; headerStyle?: StyleProp; headerForceInset?: HeaderForceInset; headerBackground?: React.ReactNode | React.ReactType; @@ -534,16 +534,16 @@ export interface TabScene { interface NavigationTabScreenOptionsBase { title?: string; tabBarIcon?: - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean; horizontal: boolean } - ) => React.ReactElement | null); + ) => React.ReactElement | null); tabBarLabel?: | string - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | string | null); + ) => React.ReactElement | string | null); tabBarVisible?: boolean; tabBarTestIDProps?: { testID?: string; accessibilityLabel?: string }; } @@ -573,16 +573,16 @@ export type DrawerLockMode = 'unlocked' | 'locked-closed' | 'locked-open'; export interface NavigationDrawerScreenOptions { title?: string; drawerIcon?: - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | null); + ) => React.ReactElement | null); drawerLabel?: | string - | React.ReactElement + | React.ReactElement | (( options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | null); + ) => React.ReactElement | null); drawerLockMode?: DrawerLockMode; } @@ -799,7 +799,7 @@ export type NavigationAnimationSetter = ( lastState: NavigationState ) => void; -export type NavigationSceneRenderer = () => React.ReactElement | null; +export type NavigationSceneRenderer = () => React.ReactElement | null; export type NavigationStyleInterpolator = ( props: NavigationSceneRendererProps @@ -1056,7 +1056,7 @@ export interface TabBarTopProps { jumpToIndex: (index: number) => void; } ) => void; - renderIcon: (scene: TabScene) => React.ReactElement; + renderIcon: (scene: TabScene) => React.ReactElement; labelStyle?: TextStyle; iconStyle?: ViewStyle; } diff --git a/types/react-navigation/v2/react-navigation-tests.tsx b/types/react-navigation/v2/react-navigation-tests.tsx index aaa69bc35b..ca90efa3eb 100644 --- a/types/react-navigation/v2/react-navigation-tests.tsx +++ b/types/react-navigation/v2/react-navigation-tests.tsx @@ -426,7 +426,7 @@ class CustomTransitioner extends React.Component /> ); } - _render = (props: NavigationTransitionProps, prevProps?: NavigationTransitionProps): React.ReactElement => { + _render = (props: NavigationTransitionProps, prevProps?: NavigationTransitionProps): React.ReactElement => { return ( ); diff --git a/types/react-overlays/lib/Dropdown.d.ts b/types/react-overlays/lib/Dropdown.d.ts index ebd4c298af..8c5266435c 100644 --- a/types/react-overlays/lib/Dropdown.d.ts +++ b/types/react-overlays/lib/Dropdown.d.ts @@ -24,7 +24,7 @@ declare namespace Dropdown { * argument should spread through to an element containing _both_ the * menu and toggle in order to handle keyboard events for focus management. */ - children(renderProps: DropdownRenderProps): React.ReactElement; + children(renderProps: DropdownRenderProps): React.ReactElement; /** * Determines the direction and location of the Menu in relation to it's Toggle. diff --git a/types/react-overlays/lib/DropdownMenu.d.ts b/types/react-overlays/lib/DropdownMenu.d.ts index c4a9090dcc..13e8a7038b 100644 --- a/types/react-overlays/lib/DropdownMenu.d.ts +++ b/types/react-overlays/lib/DropdownMenu.d.ts @@ -18,7 +18,7 @@ declare namespace DropdownMenu { * A render prop that returns a Menu element. The `props` * argument should spread through to **a component that can accept a ref**. */ - children(renderProps: DropdownMenuRenderProps): React.ReactElement; + children(renderProps: DropdownMenuRenderProps): React.ReactElement; /** * Controls the visible state of the menu, generally this is diff --git a/types/react-overlays/lib/DropdownToggle.d.ts b/types/react-overlays/lib/DropdownToggle.d.ts index d2838e8fd1..723bd5d490 100644 --- a/types/react-overlays/lib/DropdownToggle.d.ts +++ b/types/react-overlays/lib/DropdownToggle.d.ts @@ -24,6 +24,6 @@ declare namespace DropdownToggle { */ children( renderProps: DropdownToggleRenderProps - ): React.ReactElement; + ): React.ReactElement; } } diff --git a/types/react-overlays/lib/Overlay.d.ts b/types/react-overlays/lib/Overlay.d.ts index c374846188..43b95353f7 100644 --- a/types/react-overlays/lib/Overlay.d.ts +++ b/types/react-overlays/lib/Overlay.d.ts @@ -47,7 +47,7 @@ declare namespace Overlay { * A render prop that returns an element to overlay and position. See * the [react-popper documentation](https://github.com/FezVrasta/react-popper#children) for more info. */ - children(renderProps: OverlayRenderProps): React.ReactElement; + children(renderProps: OverlayRenderProps): React.ReactElement; /** * A set of popper options and props passed directly to react-popper's Popper component. diff --git a/types/react-popover/index.d.ts b/types/react-popover/index.d.ts index a7bc435d2e..1d899dba16 100644 --- a/types/react-popover/index.d.ts +++ b/types/react-popover/index.d.ts @@ -32,7 +32,7 @@ declare namespace Popover { tipSize?: number; className?: string; style?: React.CSSProperties; - target?: React.ReactElement; + target?: React.ReactElement; appendTarget?: Element; } } diff --git a/types/react-portal/index.d.ts b/types/react-portal/index.d.ts index 5faff72d87..af35fe4812 100644 --- a/types/react-portal/index.d.ts +++ b/types/react-portal/index.d.ts @@ -25,7 +25,7 @@ export interface PortalWithStateProps extends React.Props { children: (params: PortalFunctionParams) => React.ReactNode; node?: Element | null; defaultOpen?: boolean; - openByClickOn?: React.ReactElement; + openByClickOn?: React.ReactElement; closeOnEsc?: boolean; closeOnOutsideClick?: boolean; onOpen?(): void; diff --git a/types/react-redux-epic/client.d.ts b/types/react-redux-epic/client.d.ts index 54535f59ec..a22cc2072a 100644 --- a/types/react-redux-epic/client.d.ts +++ b/types/react-redux-epic/client.d.ts @@ -2,6 +2,6 @@ import * as React from 'react'; import { Observable } from 'rxjs/Observable'; export function render( - element: React.ReactElement, + element: React.ReactElement, container: Element ): Observable; diff --git a/types/react-redux-epic/index.d.ts b/types/react-redux-epic/index.d.ts index 948cd30c86..5e4302e257 100644 --- a/types/react-redux-epic/index.d.ts +++ b/types/react-redux-epic/index.d.ts @@ -18,6 +18,6 @@ export function wrapRootEpic( ): Epic; export function renderToString( - element: React.ReactElement, + element: React.ReactElement, wrappedEpic: Epic ): Observable<{ markup: string }>; diff --git a/types/react-relay/index.d.ts b/types/react-relay/index.d.ts index 2d5146289f..2d64bf5a78 100644 --- a/types/react-relay/index.d.ts +++ b/types/react-relay/index.d.ts @@ -95,7 +95,7 @@ export interface QueryRendererProps): React.ReactElement | undefined | null; + render(readyState: ReadyState): React.ReactElement | undefined | null; variables: T["variables"]; rerunParamExperimental?: RelayRuntimeTypes.RerunParam; } diff --git a/types/react-router-navigation/index.d.ts b/types/react-router-navigation/index.d.ts index 6accca7b3d..bc600c76cd 100644 --- a/types/react-router-navigation/index.d.ts +++ b/types/react-router-navigation/index.d.ts @@ -144,7 +144,7 @@ export class NavBar extends Component { } export interface NavigationComponentProps extends NavigationProps { - children?: Array>; + children?: Array; } export class Navigation extends Component { @@ -163,7 +163,7 @@ export class Navigation extends Component { export function Tab(props: TabProps): ReactElement<{}>; export interface TabBarComponentProps extends TabBarProps { - children?: Array>; + children?: Array; } export class Tabs extends Component< @@ -174,14 +174,14 @@ export class Tabs extends Component< > { props: TabBarComponentProps; - renderHeader: (sceneProps: TabSubViewProps) => ReactElement | null; + renderHeader: (sceneProps: TabSubViewProps) => ReactElement | null; - renderFooter: (sceneProps: TabSubViewProps) => ReactElement | null; + renderFooter: (sceneProps: TabSubViewProps) => ReactElement | null; renderTabBar: ( sceneProps: TabSubViewProps, props: TabSubViewProps - ) => ReactElement | null; + ) => ReactElement | null; - renderScene: (sceneProps: TabSubViewProps) => ReactElement | null; + renderScene: (sceneProps: TabSubViewProps) => ReactElement | null; } diff --git a/types/react-router/v2/lib/RouteUtils.d.ts b/types/react-router/v2/lib/RouteUtils.d.ts index 7065056ff5..36f40e7a16 100644 --- a/types/react-router/v2/lib/RouteUtils.d.ts +++ b/types/react-router/v2/lib/RouteUtils.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import Router from './Router'; -type E = React.ReactElement; +type E = React.ReactElement; export function isReactChildren(object: E | E[]): boolean; export function createRouteFromReactElement(element: E): Router.PlainRoute; export function createRoutesFromReactChildren(children: E | E[], parentRoute: Router.PlainRoute): Router.PlainRoute[]; diff --git a/types/react-router/v2/lib/Router.d.ts b/types/react-router/v2/lib/Router.d.ts index 6611fa55a9..c0d897c938 100644 --- a/types/react-router/v2/lib/Router.d.ts +++ b/types/react-router/v2/lib/Router.d.ts @@ -88,7 +88,7 @@ declare namespace Router { route?: PlainRoute; routeParams?: R; routes?: PlainRoute[]; - children?: React.ReactElement; + children?: React.ReactElement; } interface RouterOnContext extends History { diff --git a/types/react-select/lib/components/Menu.d.ts b/types/react-select/lib/components/Menu.d.ts index 387b538882..65dda94931 100644 --- a/types/react-select/lib/components/Menu.d.ts +++ b/types/react-select/lib/components/Menu.d.ts @@ -47,7 +47,7 @@ export function getMenuPlacement(args: PlacementArgs): MenuState; export type MenuProps = CommonProps & { /** The children to be rendered. */ - children: ReactElement, + children: ReactElement, /** Callback to update the portal after possible flip. */ getPortalPlacement: (state: MenuState) => void, /** Props to be passed to the menu wrapper. */ diff --git a/types/react-sortable-hoc/index.d.ts b/types/react-sortable-hoc/index.d.ts index 6a89c766e5..fa07d3a60c 100644 --- a/types/react-sortable-hoc/index.d.ts +++ b/types/react-sortable-hoc/index.d.ts @@ -36,7 +36,7 @@ export interface SortEnd { export type SortEndHandler = (sort: SortEnd, event: SortEvent) => void; -export type ContainerGetter = (element: React.ReactElement) => HTMLElement; +export type ContainerGetter = (element: React.ReactElement) => HTMLElement; export interface Dimensions { width: number; diff --git a/types/react-sticky-el/index.d.ts b/types/react-sticky-el/index.d.ts index da831c9d61..d7bfba0ec8 100644 --- a/types/react-sticky-el/index.d.ts +++ b/types/react-sticky-el/index.d.ts @@ -41,7 +41,7 @@ declare namespace Sticky { * * Defaults to 'div'. */ - wrapperCmp?: keyof React.ReactHTML | React.ReactElement; + wrapperCmp?: keyof React.ReactHTML | React.ReactElement; /** * Anything that can be used by React.createElement. Used for holder diff --git a/types/react-sticky/index.d.ts b/types/react-sticky/index.d.ts index 0bc4e2c0f2..8920092e1d 100644 --- a/types/react-sticky/index.d.ts +++ b/types/react-sticky/index.d.ts @@ -22,7 +22,7 @@ export interface StickyChildArgs { } export interface StickyProps { - children: (args: StickyChildArgs) => React.ReactElement; + children: (args: StickyChildArgs) => React.ReactElement; relative?: boolean; isActive?: boolean; className?: string; diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index b4b2d3d07f..6aad7c3c8c 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -14,7 +14,7 @@ export type AccessorFunction = (row: D) => any; export type Accessor = string | string[] | AccessorFunction; export type Aggregator = (values: any, rows: any) => any; export type TableCellRenderer = ((cellInfo: CellInfo, column: any) => React.ReactNode) | React.ReactNode; -export type FilterRender = (params: { column: Column, filter: any, onChange: ReactTableFunction, key?: string }) => React.ReactElement; +export type FilterRender = (params: { column: Column, filter: any, onChange: ReactTableFunction, key?: string }) => React.ReactElement; export type PivotRenderer = ((cellInfo: CellInfo) => React.ReactNode) | (() => any) | string | React.ReactNode; export type ComponentPropsGetter0 = (finalState: any, rowInfo: undefined, column: undefined, instance?: any) => object | undefined; @@ -187,7 +187,7 @@ export interface TableProps extends /** Control callback for functional rendering */ children: ( state: FinalState, - makeTable: () => React.ReactElement, + makeTable: () => React.ReactElement, instance: Instance ) => React.ReactNode; } diff --git a/types/react-test-renderer/index.d.ts b/types/react-test-renderer/index.d.ts index abdae1c908..9d2b53db40 100644 --- a/types/react-test-renderer/index.d.ts +++ b/types/react-test-renderer/index.d.ts @@ -42,15 +42,15 @@ export interface ReactTestInstance { export interface ReactTestRenderer { toJSON(): null | ReactTestRendererJSON; toTree(): null | ReactTestRendererTree; - unmount(nextElement?: ReactElement): void; - update(nextElement: ReactElement): void; + unmount(nextElement?: ReactElement): void; + update(nextElement: ReactElement): void; getInstance(): null | ReactTestInstance; root: ReactTestInstance; } export interface TestRendererOptions { - createNodeMock(element: ReactElement): any; + createNodeMock(element: ReactElement): any; } -export function create(nextElement: ReactElement, options?: TestRendererOptions): ReactTestRenderer; +export function create(nextElement: ReactElement, options?: TestRendererOptions): ReactTestRenderer; /** * Wrap any code rendering and triggering updates to your components into `act()` calls. diff --git a/types/react-test-renderer/react-test-renderer-tests.ts b/types/react-test-renderer/react-test-renderer-tests.ts index 48d861cf62..f8bcb14d2d 100644 --- a/types/react-test-renderer/react-test-renderer-tests.ts +++ b/types/react-test-renderer/react-test-renderer-tests.ts @@ -5,7 +5,7 @@ import { createRenderer } from 'react-test-renderer/shallow'; class TestComponent extends React.Component { } const renderer = create(React.createElement("div"), { - createNodeMock: (el: React.ReactElement) => { + createNodeMock: (el: React.ReactElement) => { return {}; } }); diff --git a/types/react-test-renderer/shallow/index.d.ts b/types/react-test-renderer/shallow/index.d.ts index f51fa1e355..2c5fda1be6 100644 --- a/types/react-test-renderer/shallow/index.d.ts +++ b/types/react-test-renderer/shallow/index.d.ts @@ -8,15 +8,15 @@ export interface ShallowRenderer { /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput>(): E; + getRenderOutput(): E; /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput(): ReactElement; + getRenderOutput(): ReactElement; /** * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep. */ - render(element: ReactElement, context?: any): void; + render(element: ReactElement, context?: any): void; unmount(): void; } diff --git a/types/react-test-renderer/v15/index.d.ts b/types/react-test-renderer/v15/index.d.ts index 9c65a34140..ddb8adb466 100644 --- a/types/react-test-renderer/v15/index.d.ts +++ b/types/react-test-renderer/v15/index.d.ts @@ -8,8 +8,8 @@ import { ReactElement } from "react"; export interface ReactTestInstance { toJSON(): ReactTestRendererJSON; - unmount(nextElement?: ReactElement): void; - update(nextElement: ReactElement): void; + unmount(nextElement?: ReactElement): void; + update(nextElement: ReactElement): void; getInstance(): any; } export interface ReactTestRendererJSON { @@ -19,7 +19,7 @@ export interface ReactTestRendererJSON { $$typeof?: any; } export interface TestRendererOptions { - createNodeMock(element: ReactElement): any; + createNodeMock(element: ReactElement): any; } // https://github.com/facebook/react/blob/master/src/renderers/testing/ReactTestMount.js#L155 -export function create(nextElement: ReactElement, options?: TestRendererOptions): ReactTestInstance; +export function create(nextElement: ReactElement, options?: TestRendererOptions): ReactTestInstance; diff --git a/types/react-test-renderer/v15/react-test-renderer-tests.ts b/types/react-test-renderer/v15/react-test-renderer-tests.ts index 810fdad407..fcdbd72249 100644 --- a/types/react-test-renderer/v15/react-test-renderer-tests.ts +++ b/types/react-test-renderer/v15/react-test-renderer-tests.ts @@ -3,7 +3,7 @@ import { create } from "react-test-renderer"; import { createRenderer } from 'react-test-renderer/shallow'; const tree = create(React.createElement("div"), { - createNodeMock: (el: React.ReactElement) => { + createNodeMock: (el: React.ReactElement) => { return {}; } }).toJSON(); diff --git a/types/react-test-renderer/v15/shallow/index.d.ts b/types/react-test-renderer/v15/shallow/index.d.ts index 493ad4a777..190e1b56a6 100644 --- a/types/react-test-renderer/v15/shallow/index.d.ts +++ b/types/react-test-renderer/v15/shallow/index.d.ts @@ -4,15 +4,15 @@ export interface ShallowRenderer { /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput>(): E; + getRenderOutput(): E; /** * After `shallowRenderer.render()` has been called, returns shallowly rendered output. */ - getRenderOutput(): ReactElement; + getRenderOutput(): ReactElement; /** * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep. */ - render(element: ReactElement, context?: any): void; + render(element: ReactElement, context?: any): void; unmount(): void; } diff --git a/types/react-toastify/index.d.ts b/types/react-toastify/index.d.ts index 0bde299cd4..c15add1fac 100644 --- a/types/react-toastify/index.d.ts +++ b/types/react-toastify/index.d.ts @@ -136,7 +136,7 @@ export interface ToastOptions extends ToastAndToastContainerOptions { /** * String or React Element, only available when calling update. */ - render?: string | React.ReactElement; + render?: string | React.ReactElement; } export interface Toast { diff --git a/types/react-transition-group/TransitionGroup.d.ts b/types/react-transition-group/TransitionGroup.d.ts index c7f42a009a..48bc9bbe6d 100644 --- a/types/react-transition-group/TransitionGroup.d.ts +++ b/types/react-transition-group/TransitionGroup.d.ts @@ -13,7 +13,7 @@ declare namespace TransitionGroup { type TransitionGroupProps = (IntrinsicTransitionGroupProps & JSX.IntrinsicElements[T]) | (ComponentTransitionGroupProps) & { children?: ReactElement | Array>; - childFactory?(child: ReactElement): ReactElement; + childFactory?(child: ReactElement): ReactElement; [prop: string]: any; }; } diff --git a/types/react-transition-group/react-transition-group-tests.tsx b/types/react-transition-group/react-transition-group-tests.tsx index cda468f9b5..c7fb1aede0 100644 --- a/types/react-transition-group/react-transition-group-tests.tsx +++ b/types/react-transition-group/react-transition-group-tests.tsx @@ -42,7 +42,7 @@ const Test: React.StatelessComponent = () => { component={Container} theme="test" className="animated-list" - childFactory={ (child: React.ReactElement) => child } + childFactory={ (child: React.ReactElement) => child } > extends HTMLAttributes { component?: ReactType; - childFactory?(child: ReactElement): ReactElement; + childFactory?(child: ReactElement): ReactElement; } import TransitionGroup = require("./TransitionGroup"); diff --git a/types/react-visibility-sensor/index.d.ts b/types/react-visibility-sensor/index.d.ts index 80cda84d19..c1bdd353a1 100644 --- a/types/react-visibility-sensor/index.d.ts +++ b/types/react-visibility-sensor/index.d.ts @@ -39,7 +39,7 @@ interface Props { resizeThrottle?: number; containment?: HTMLElement; delayedCall?: boolean; - children?: React.ReactElement | ChildFunction; + children?: React.ReactElement | ChildFunction; } declare const ReactVisibilitySensor: React.StatelessComponent; diff --git a/types/react/test/index.ts b/types/react/test/index.ts index ada2f860ba..d4fee49d30 100644 --- a/types/react/test/index.ts +++ b/types/react/test/index.ts @@ -494,7 +494,7 @@ const mappedChildrenArrayWithKnownChildren: number[] = React.Children.map(childrenArray, (child) => child.props.p); React.Children.forEach(children, (child) => { }); const nChildren: number = React.Children.count(children); -let onlyChild: React.ReactElement = React.Children.only(DOM.div()); // ok +let onlyChild: React.ReactElement = React.Children.only(DOM.div()); // ok onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); // error const childrenToArray: React.ReactChild[] = React.Children.toArray(children); diff --git a/types/react/v15/index.d.ts b/types/react/v15/index.d.ts index ce2a523123..2e4fd31667 100644 --- a/types/react/v15/index.d.ts +++ b/types/react/v15/index.d.ts @@ -180,7 +180,7 @@ declare namespace React { // ---------------------------------------------------------------------- type ReactText = string | number; - type ReactChild = ReactElement | ReactText; + type ReactChild = ReactElement | ReactText; interface ReactNodeArray extends Array {} type ReactFragment = {} | ReactNodeArray; @@ -343,7 +343,7 @@ declare namespace React { type SFC

= StatelessComponent

; interface StatelessComponent

{ - (props: P & { children?: ReactNode }, context?: any): ReactElement | null; + (props: P & { children?: ReactNode }, context?: any): ReactElement | null; propTypes?: ValidationMap

; contextTypes?: ValidationMap; defaultProps?: Partial

; @@ -404,7 +404,7 @@ declare namespace React { } interface ComponentSpec extends Mixin { - render(): ReactElement | null; + render(): ReactElement | null; [propertyName: string]: any; } @@ -3581,11 +3581,11 @@ declare namespace React { // ---------------------------------------------------------------------- interface ReactChildren { - map>(children: C[], fn: (child: C, index: number) => T): T[]; + map(children: C[], fn: (child: C, index: number) => T): T[]; map(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[]; forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; count(children: ReactNode): number; - only(children: ReactNode): ReactElement; + only(children: ReactNode): ReactElement; toArray(children: ReactNode): ReactChild[]; } @@ -3621,7 +3621,7 @@ declare namespace React { declare global { namespace JSX { // tslint:disable-next-line:no-empty-interface - interface Element extends React.ReactElement { } + interface Element extends React.ReactElement { } interface ElementClass extends React.Component { render(): JSX.Element | null | false; } diff --git a/types/react/v15/test/index.ts b/types/react/v15/test/index.ts index 79d05ac8d0..fe80439752 100644 --- a/types/react/v15/test/index.ts +++ b/types/react/v15/test/index.ts @@ -441,7 +441,7 @@ const PropTypesSpecification: React.ComponentSpec = { return null; } }, - render: (): React.ReactElement | null => { + render: (): React.ReactElement | null => { return null; } }; @@ -498,7 +498,7 @@ const mappedChildrenArrayWithKnownChildren: number[] = React.Children.map(childrenArray, (child) => child.props.p); React.Children.forEach(children, (child) => { }); const nChildren: number = React.Children.count(children); -let onlyChild: React.ReactElement = React.Children.only(React.DOM.div()); // ok +let onlyChild: React.ReactElement = React.Children.only(React.DOM.div()); // ok onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); // error const childrenToArray: React.ReactChild[] = React.Children.toArray(children); diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index fc127e9251..8bf734c21f 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -171,9 +171,9 @@ export interface AreaProps extends EventAttributes, Partial | ContentRenderer; - dot?: boolean | object | React.ReactElement | ContentRenderer; - label?: boolean | object | ContentRenderer | React.ReactElement; + activeDot?: boolean | object | React.ReactElement | ContentRenderer; + dot?: boolean | object | React.ReactElement | ContentRenderer; + label?: boolean | object | ContentRenderer | React.ReactElement; hide?: boolean; layout?: LayoutType; baseLine?: number | any[]; @@ -214,9 +214,9 @@ export interface BarProps extends EventAttributes, Partial | ContentRenderer; + shape?: React.ReactElement | ContentRenderer; data?: BarData[]; - background?: boolean | React.ReactElement | ContentRenderer | object; + background?: boolean | React.ReactElement | ContentRenderer | object; // see label section at http://recharts.org/#/en-US/api/Bar label?: boolean | Label | React.SFC | React.ReactElement | ContentRenderer; } @@ -258,7 +258,7 @@ export interface CartesianAxisProps extends EventAttributes, Partial | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; mirror?: boolean; @@ -284,8 +284,8 @@ export interface CartesianGridProps extends Partial { y?: number; width?: number; height?: number; - horizontal?: object | React.ReactElement | ContentRenderer | boolean; - vertical?: object | React.ReactElement | ContentRenderer | boolean; + horizontal?: object | React.ReactElement | ContentRenderer | boolean; + vertical?: object | React.ReactElement | ContentRenderer | boolean; horizontalPoints?: number[]; verticalPoints?: number[]; horizontalCoordinatesGenerator?: CoordinatesGenerator; @@ -375,7 +375,7 @@ export interface LegendPayload { export type BBoxUpdateCallback = (box: { width: number; height: number; }) => void; export interface LegendProps { - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; wrapperStyle?: object; chartWidth?: number; chartHeight?: number; @@ -410,15 +410,15 @@ export interface LineProps extends EventAttributes, Partial | ContentRenderer | boolean; - dot?: object | React.ReactElement | ContentRenderer | boolean; + activeDot?: object | React.ReactElement | ContentRenderer | boolean; + dot?: object | React.ReactElement | ContentRenderer | boolean; top?: number; left?: number; width?: number; height?: number; data?: object[]; dataKey: DataKey; // As the source code states, dataKey will replace valueKey in 1.1.0 and it'll be required (it's already required in current implementation). - label?: boolean | object | React.ReactElement | ContentRenderer; + label?: boolean | object | React.ReactElement | ContentRenderer; points?: Point[]; } @@ -449,11 +449,11 @@ export interface PieProps extends EventAttributes, Partial | React.ReactElement | boolean; + labelLine?: object | ContentRenderer | React.ReactElement | boolean; label?: { offsetRadius: number; - } | React.ReactElement | ContentRenderer | boolean; - activeShape?: object | ContentRenderer | React.ReactElement; + } | React.ReactElement | ContentRenderer | boolean; + activeShape?: object | ContentRenderer | React.ReactElement; activeIndex?: number | number[]; blendStroke?: boolean; } @@ -500,7 +500,7 @@ export interface PolarAngleAxisProps extends EventAttributes, Partial | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; ticks?: PolarAngleAxisTick[]; stroke?: string; orientation?: 'inner' | 'outer'; @@ -539,7 +539,7 @@ export interface PolarRadiusAxisProps extends EventAttributes, Partial | ContentRenderer; + tick?: boolean | object | React.ReactElement | ContentRenderer; stroke?: string; tickFormatter?: TickFormatterFunction; domain?: [PolarRadiusAxisDomain, PolarRadiusAxisDomain]; @@ -576,10 +576,10 @@ export interface RadarProps extends EventAttributes, Partial | ContentRenderer; - activeDot?: object | React.ReactElement | ContentRenderer | boolean; - dot?: object | React.ReactElement | ContentRenderer | boolean; - label?: object | React.ReactElement | ContentRenderer | boolean; + shape?: React.ReactElement | ContentRenderer; + activeDot?: object | React.ReactElement | ContentRenderer | boolean; + dot?: object | React.ReactElement | ContentRenderer | boolean; + label?: object | React.ReactElement | ContentRenderer | boolean; legendType?: LegendType; hide?: boolean; } @@ -611,15 +611,15 @@ export interface RadialBarProps extends EventAttributes, Partial | React.ReactElement; - activeShape?: object | ContentRenderer | React.ReactElement; + shape?: ContentRenderer | React.ReactElement; + activeShape?: object | ContentRenderer | React.ReactElement; cornerRadius?: number | string; minPointSize?: number; maxBarSize?: number; data?: RadialBarData[]; legendType?: LegendType; - label?: boolean | React.ReactElement | ContentRenderer | object; - background?: boolean | React.ReactElement | ContentRenderer | object; + label?: boolean | React.ReactElement | ContentRenderer | object; + background?: boolean | React.ReactElement | ContentRenderer | object; hide?: boolean; } @@ -661,7 +661,7 @@ export interface ReferenceAreaProps extends Partial { y2?: number | string; xAxisId?: string | number; yAxisId?: string | number; - shape?: ContentRenderer | React.ReactElement; + shape?: ContentRenderer | React.ReactElement; } export class ReferenceArea extends React.Component { } @@ -687,7 +687,7 @@ export interface ReferenceDotProps extends EventAttributes, Partial> & { cx: number; cy: number; } - > | React.ReactElement; + > | React.ReactElement; } export class ReferenceDot extends React.Component { } @@ -702,14 +702,14 @@ export interface ReferenceLineProps extends Partial | React.ReactElement; + label?: string | number | ContentRenderer | React.ReactElement; xAxisId?: string | number; yAxisId?: string | number; shape?: ContentRenderer< EventAttributes & Partial> & { x1: number; y1: number; x2: number; y2: number; } - > | React.ReactElement; + > | React.ReactElement; } export class ReferenceLine extends React.Component { } @@ -745,13 +745,13 @@ export interface ScatterProps extends EventAttributes, Partial; + line?: boolean | object | RechartsFunction | React.ReactElement; lineType?: 'joint' | 'fitting'; lineJointType?: LineType; legendType?: LegendType; activeIndex?: number; - activeShape?: object | RechartsFunction | React.ReactElement; - shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | ContentRenderer; + activeShape?: object | RechartsFunction | React.ReactElement; + shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | ContentRenderer; points?: ScatterPoint[]; hide?: boolean; data?: object[]; @@ -823,7 +823,7 @@ export interface TooltipPayload { } export interface TooltipProps extends Animatable { - content?: React.ReactElement | React.StatelessComponent | ContentRenderer; + content?: React.ReactElement | React.StatelessComponent | ContentRenderer; viewBox?: ViewBox; active?: boolean; separator?: string; @@ -832,7 +832,7 @@ export interface TooltipProps extends Animatable { itemStyle?: object; labelStyle?: object; wrapperStyle?: object; - cursor?: boolean | object | React.ReactElement | React.StatelessComponent; + cursor?: boolean | object | React.ReactElement | React.StatelessComponent; coordinate?: Coordinate; position?: Coordinate; label?: string | number; @@ -851,7 +851,7 @@ export interface TreemapProps extends EventAttributes, Animatable { data?: any[]; style?: object; aspectRatio?: number; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; fill?: string; stroke?: string; className?: string; @@ -873,7 +873,7 @@ export interface LabelProps extends Partial { position?: PositionType; children?: React.ReactNode[] | React.ReactNode; className?: string; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; } export class LabelList extends React.Component { } @@ -883,7 +883,7 @@ export interface LabelListProps { children?: React.ReactNode[] | React.ReactNode; className?: string; clockWise?: boolean; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; data?: number; dataKey: string | number | RechartsFunction; formatter?: LabelFormatter; @@ -934,7 +934,7 @@ export interface XAxisProps extends EventAttributes { padding?: XPadding; allowDataOverflow?: boolean; scale?: ScaleType | RechartsFunction; - tick?: boolean | ContentRenderer | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; minTickGap?: number; @@ -988,7 +988,7 @@ export interface YAxisProps extends EventAttributes { padding?: YPadding; allowDataOverflow?: boolean; scale?: ScaleType | RechartsFunction; - tick?: boolean | ContentRenderer | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; minTickGap?: number; diff --git a/types/recompose/index.d.ts b/types/recompose/index.d.ts index f571753468..540e1128dd 100644 --- a/types/recompose/index.d.ts +++ b/types/recompose/index.d.ts @@ -269,7 +269,7 @@ declare module 'recompose' { // toRenderProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#torenderprops export function toRenderProps( hoc: InferableComponentEnhancerWithProps - ): StatelessComponent React.ReactElement }>; + ): StatelessComponent React.ReactElement }>; // fromRenderProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#fromrenderprops export function fromRenderProps( @@ -335,10 +335,10 @@ declare module 'recompose' { type: Component | string, props?: Object, children?: React.ReactNode - ): React.ReactElement; + ): React.ReactElement; // createEagerFactory: https://github.com/acdlite/recompose/blob/master/docs/API.md#createEagerFactory - type componentFactory = (props?: Object, children?: React.ReactNode) => React.ReactElement; + type componentFactory = (props?: Object, children?: React.ReactNode) => React.ReactElement; export function createEagerFactory( type: Component | string ): componentFactory; diff --git a/types/recompose/recompose-tests.tsx b/types/recompose/recompose-tests.tsx index 53cf796fd6..5be4d4ddbc 100644 --- a/types/recompose/recompose-tests.tsx +++ b/types/recompose/recompose-tests.tsx @@ -533,7 +533,7 @@ function testFromRenderProps() { } interface RenderComponentProps { - render: (renderProps: RenderProps) => React.ReactElement; + render: (renderProps: RenderProps) => React.ReactElement; } class RenderPropComponent extends React.Component { diff --git a/types/redux-devtools/index.d.ts b/types/redux-devtools/index.d.ts index ddead025ff..e457839d2f 100644 --- a/types/redux-devtools/index.d.ts +++ b/types/redux-devtools/index.d.ts @@ -12,7 +12,7 @@ export interface IDevTools { instrument(): GenericStoreEnhancer } -export declare function createDevTools(el: React.ReactElement): IDevTools; +export declare function createDevTools(el: React.ReactElement): IDevTools; export declare function persistState(debugSessionKey: string): GenericStoreEnhancer; declare const factory: { instrument(): (opts: any) => any }; diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 8997d682a8..565f565448 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -28,7 +28,7 @@ export interface ErrorOther { } export type FormErrors = { - [P in keyof FormData]?: ReactElement | T; + [P in keyof FormData]?: ReactElement | T; } & ErrorOther; export interface WarningOther { @@ -36,7 +36,7 @@ export interface WarningOther { } export type FormWarnings = { - [P in keyof FormData]?: ReactElement | string | WarningOther; + [P in keyof FormData]?: ReactElement | string | WarningOther; }; export interface RegisteredFieldState { diff --git a/types/redux-form/v6/index.d.ts b/types/redux-form/v6/index.d.ts index 63921312b8..360830215f 100644 --- a/types/redux-form/v6/index.d.ts +++ b/types/redux-form/v6/index.d.ts @@ -30,11 +30,11 @@ export interface DataShape { } export type FormErrors = { - [P in keyof FormData]?: ReactElement | string | { _error?: string }; + [P in keyof FormData]?: ReactElement | string | { _error?: string }; }; export type FormWarnings = { - [P in keyof FormData]?: ReactElement | string | { _warning?: string }; + [P in keyof FormData]?: ReactElement | string | { _warning?: string }; }; export type FormMeta = { diff --git a/types/rheostat/rheostat-tests.tsx b/types/rheostat/rheostat-tests.tsx index 263e287f6f..cb07cd6a2e 100644 --- a/types/rheostat/rheostat-tests.tsx +++ b/types/rheostat/rheostat-tests.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Rheostat, { Orientation, Algorithm, PublicState } from 'rheostat'; -type Element = React.ReactElement; +type Element = React.ReactElement; function Basic(props: {}): Element { return ; diff --git a/types/storybook-addon-jsx/index.d.ts b/types/storybook-addon-jsx/index.d.ts index b1bd874cdd..e3fbd63368 100644 --- a/types/storybook-addon-jsx/index.d.ts +++ b/types/storybook-addon-jsx/index.d.ts @@ -7,7 +7,7 @@ import '@storybook/react'; import { ReactNode, ReactElement } from 'react'; -export type displayNameFunc = (element: ReactElement) => string; +export type displayNameFunc = (element: ReactElement) => string; declare module '@storybook/react' { interface Options { diff --git a/types/storybook__addon-storyshots/index.d.ts b/types/storybook__addon-storyshots/index.d.ts index 7de2fa1dca..20de92a31c 100644 --- a/types/storybook__addon-storyshots/index.d.ts +++ b/types/storybook__addon-storyshots/index.d.ts @@ -70,7 +70,7 @@ export interface InitOptions { storyNameRegex?: RegExp; framework?: string; test?: Test; - renderer?: (node: React.ReactElement) => Rendered; + renderer?: (node: React.ReactElement) => Rendered; serializer?: (rendered: Rendered) => any; integrityOptions?: {}; } diff --git a/types/theming/index.d.ts b/types/theming/index.d.ts index e2525b3ce6..0ac816e14d 100644 --- a/types/theming/index.d.ts +++ b/types/theming/index.d.ts @@ -19,7 +19,7 @@ export function withTheme

( export interface ThemeProviderProps { theme: Theme; - children?: React.ReactElement; + children?: React.ReactElement; } /** * Provide a theme to an entire react component listening on the default channel diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index e2f1cb8111..58343cf6c2 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -54,7 +54,7 @@ declare module "victory" { * The child of should be a function that takes an object of tweened values and returns a component to render. * @param style */ - children?: (style: AnimationStyle) => React.ReactElement; + children?: (style: AnimationStyle) => React.ReactElement; /** * The number of milliseconds the animation should take to complete. * @default 1000 @@ -280,7 +280,7 @@ declare module "victory" { * If a cursorComponent is not supplied, a new Line component will be rendered. * @default cursorComponent={} */ - cursorComponent?: React.ReactElement; + cursorComponent?: React.ReactElement; /** * When the cursorDimension prop is set, the cursor will be a line to inspect the given dimension (either "x" or "y"). * When this prop is not specified, the cursor will be a 2-dimensional crosshair. @@ -303,7 +303,7 @@ declare module "victory" { * active, text. If cursorLabelComponent is omitted, a new VictoryLabel will be created with the props described above. * @default cursorLabelComponent={} */ - cursorLabelComponent?: React.ReactElement; + cursorLabelComponent?: React.ReactElement; /** * The cursorLabelOffset prop determines the pixel offset of the cursor label * from the cursor point. This prop should be an Object with x and y properties, or a @@ -355,7 +355,7 @@ declare module "victory" { * width, height, and style. When this prop is not specified, a will be rendered. * @default brushComponent={} */ - brushComponent?: React.ReactElement; + brushComponent?: React.ReactElement; /** * When the brushDimension prop is set, brushing will only be specific to the to * the given dimension (either "x" or "y"), and the entire domain of the other @@ -398,7 +398,7 @@ declare module "victory" { * specified, a will be rendered. * @default handleComponent={} */ - handleComponent?: React.ReactElement; + handleComponent?: React.ReactElement; /** * The handleStyle adds custom styles to the handleComponents. This prop should be given as an object of SVG style attributes. * @@ -440,7 +440,7 @@ declare module "victory" { * props on VictoryClipContainer, such as clipPadding. * @example clipContainerComponent={} */ - clipContainerComponent?: React.ReactElement; + clipContainerComponent?: React.ReactElement; /** * When the zoomDimension prop is set, panning and zooming will be restricted to * the given dimension (either x or y), and the domain of the other dimension will @@ -605,12 +605,12 @@ declare module "victory" { * Examples: flyoutComponent={}, flyoutComponent={} * @default */ - flyoutComponent?: React.ReactElement; + flyoutComponent?: React.ReactElement; /** * The groupComponent prop takes a component instance which will be used to create group elements for use within container elements. This prop defaults to a tag. * @default groupComponent={} */ - groupComponent?: React.ReactElement; + groupComponent?: React.ReactElement; /** * The height prop defines the height of the tooltip flyout. This prop may be given as a positive number or a function of datum. * If this prop is not set, height will be determined based on an approximate text size calculated from the text and style props provided to VictoryTooltip. @@ -634,7 +634,7 @@ declare module "victory" { * Examples: labelComponent={}, labelComponent={} * @default */ - labelComponent?: React.ReactElement; + labelComponent?: React.ReactElement; /** * The orientation prop determines which side of the (x, y) coordinate the tooltip should be rendered on. * This prop can be given as “top”, “bottom”, “left”, “right”, or as a function of datum that returns one of these values. @@ -902,7 +902,7 @@ declare module "victory" { * @example * @default */ - containerComponent?: React.ReactElement; + containerComponent?: React.ReactElement; /** * The theme prop takes a style object with nested data, labels, and parent objects. * You can create this object yourself, or you can use a theme provided by Victory. @@ -919,7 +919,7 @@ declare module "victory" { * to a tag on web, and a react-native-svg tag on mobile * @default */ - groupComponent?: React.ReactElement; + groupComponent?: React.ReactElement; } /** @@ -953,7 +953,7 @@ declare module "victory" { * not provided, VictoryArea will use its default Area component. * @default */ - dataComponent?: React.ReactElement; + dataComponent?: React.ReactElement; /** * The domain prop describes the range of values your chart will cover. This prop can be * given as a array of the minimum and maximum expected values for your bar chart, @@ -1003,7 +1003,7 @@ declare module "victory" { * data point, they should be created by composing VictoryArea with VictoryScatter * @default */ - labelComponent?: React.ReactElement; + labelComponent?: React.ReactElement; } interface VictoryMultiLabeableProps extends VictoryLabableProps { @@ -1108,7 +1108,7 @@ declare module "victory" { * is not supplied, VictoryAxis will render its default AxisLine component. * @default */ - axisComponent?: React.ReactElement; + axisComponent?: React.ReactElement; /** * The axisLabelComponent prop takes in an entire component which will be used * to create the axis label. The new element created from the passed axisLabelComponent @@ -1119,7 +1119,7 @@ declare module "victory" { * VictoryLabel will be created with props described above * @default */ - axisLabelComponent?: React.ReactElement; + axisLabelComponent?: React.ReactElement; /** * This prop specifies whether a given axis is intended to cross another axis. */ @@ -1193,7 +1193,7 @@ declare module "victory" { * is not supplied, VictoryAxis will render its default GridLine component. * @default */ - gridComponent?: React.ReactElement; + gridComponent?: React.ReactElement; /** * If true, this value will flip the domain of a given axis. */ @@ -1270,7 +1270,7 @@ declare module "victory" { * is not supplied, VictoryAxis will render its default Tick component. * @default */ - tickComponent?: React.ReactElement; + tickComponent?: React.ReactElement; /** * The tickCount prop specifies approximately how many ticks should be drawn on the axis if * tickValues are not explicitly provided. This value is calculated by d3 scale and @@ -1290,7 +1290,7 @@ declare module "victory" { * VictoryLabel will be created with props described above * @default */ - tickLabelComponent?: React.ReactElement; + tickLabelComponent?: React.ReactElement; /** * The tickFormat prop specifies how tick values should be expressed visually. * tickFormat can be given as a function to be applied to every tickValue, or as @@ -1876,7 +1876,7 @@ declare module "victory" { * VictoryPortal to force components to render above other children. * @default */ - containerComponent?: React.ReactElement; + containerComponent?: React.ReactElement; /** * Specify data via the data prop. VictoryLegend expects data as an * array of objects with name (required), symbol, and labels properties. @@ -1907,14 +1907,14 @@ declare module "victory" { * If a dataComponent is not provided, VictoryLegend will use its * default Point component. */ - dataComponent?: React.ReactElement; + dataComponent?: React.ReactElement; /** * The groupComponent prop takes an entire component which will be used to * create group elements for use within container elements. This prop defaults * to a tag on web, and a react-native-svg tag on mobile * @default */ - groupComponent?: React.ReactElement; + groupComponent?: React.ReactElement; /** * The gutter prop defines the number of pixels between legend rows or * columns, depending on orientation. When orientation is horizontal, @@ -1931,7 +1931,7 @@ declare module "victory" { * custom component itself. If labelComponent is omitted, a new * VictoryLabel will be created with the props described above. */ - labelComponent?: React.ReactElement; + labelComponent?: React.ReactElement; /** * The orientation prop takes a string that defines whether legend data * are displayed in a row or column. When orientation is "horizontal", @@ -2211,7 +2211,7 @@ declare module "victory" { * the VictoryPie; and the d3 compatible slice object. * If a dataComponent is not provided, VictoryPie's Slice component will be used. */ - dataComponent?: React.ReactElement; + dataComponent?: React.ReactElement; /** * The labelRadius prop defines the radius of the arc that will be used for positioning each slice label. * If this prop is not set, the label radius will default to the radius of the pie + label padding.