@types/react 16.8.4 → 16.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- react/README.md +1 -1
- react/index.d.ts +6 -4
- react/package.json +4 -3
react/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React ( http://facebook.github.io/rea
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react
|
9
9
|
|
10
10
|
Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Mon, 25 Feb 2019 23:06:26 GMT
|
12
12
|
* Dependencies: @types/csstype, @types/prop-types
|
13
13
|
* Global values: React
|
14
14
|
|
react/index.d.ts
CHANGED
@@ -422,7 +422,7 @@ declare namespace React {
|
|
422
422
|
// always pass children as variadic arguments to `createElement`.
|
423
423
|
// In the future, if we can define its call signature conditionally
|
424
424
|
// on the existence of `children` in `P`, then we should remove this.
|
425
|
-
readonly props: Readonly<
|
425
|
+
readonly props: Readonly<PropsWithChildren<P>>;
|
426
426
|
state: Readonly<S>;
|
427
427
|
/**
|
428
428
|
* @deprecated
|
@@ -468,7 +468,7 @@ declare namespace React {
|
|
468
468
|
type FC<P = {}> = FunctionComponent<P>;
|
469
469
|
|
470
470
|
interface FunctionComponent<P = {}> {
|
471
|
-
(props: P
|
471
|
+
(props: PropsWithChildren<P>, context?: any): ReactElement | null;
|
472
472
|
propTypes?: WeakValidationMap<P>;
|
473
473
|
contextTypes?: ValidationMap<any>;
|
474
474
|
defaultProps?: Partial<P>;
|
@@ -476,7 +476,7 @@ declare namespace React {
|
|
476
476
|
}
|
477
477
|
|
478
478
|
interface RefForwardingComponent<T, P = {}> {
|
479
|
-
(props: P
|
479
|
+
(props: PropsWithChildren<P>, ref: Ref<T>): ReactElement | null;
|
480
480
|
propTypes?: WeakValidationMap<P>;
|
481
481
|
contextTypes?: ValidationMap<any>;
|
482
482
|
defaultProps?: Partial<P>;
|
@@ -722,6 +722,8 @@ declare namespace React {
|
|
722
722
|
: P
|
723
723
|
: P;
|
724
724
|
|
725
|
+
type PropsWithChildren<P> = P & { children?: ReactNode };
|
726
|
+
|
725
727
|
/**
|
726
728
|
* NOTE: prefer ComponentPropsWithRef, if the ref is forwarded,
|
727
729
|
* or ComponentPropsWithoutRef when refs are not supported.
|
@@ -747,7 +749,7 @@ declare namespace React {
|
|
747
749
|
|
748
750
|
function memo<P extends object>(
|
749
751
|
Component: SFC<P>,
|
750
|
-
propsAreEqual?: (prevProps: Readonly<P
|
752
|
+
propsAreEqual?: (prevProps: Readonly<PropsWithChildren<P>>, nextProps: Readonly<PropsWithChildren<P>>) => boolean
|
751
753
|
): NamedExoticComponent<P>;
|
752
754
|
function memo<T extends ComponentType<any>>(
|
753
755
|
Component: T,
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "16.8.
|
3
|
+
"version": "16.8.5",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"license": "MIT",
|
6
6
|
"contributors": [
|
@@ -111,13 +111,14 @@
|
|
111
111
|
"types": "index",
|
112
112
|
"repository": {
|
113
113
|
"type": "git",
|
114
|
-
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
114
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
115
|
+
"directory": "types/react"
|
115
116
|
},
|
116
117
|
"scripts": {},
|
117
118
|
"dependencies": {
|
118
119
|
"@types/prop-types": "*",
|
119
120
|
"csstype": "^2.2.0"
|
120
121
|
},
|
121
|
-
"typesPublisherContentHash": "
|
122
|
+
"typesPublisherContentHash": "c1110ffd4d8413625cd4a49f91896ff4bdf7a89150082135075687ed9b9dd0da",
|
122
123
|
"typeScriptVersion": "2.8"
|
123
124
|
}
|