@types/react 16.14.36 → 16.14.37
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 v16.14/README.md +1 -1
- react v16.14/index.d.ts +34 -34
- react v16.14/package.json +2 -2
react v16.14/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React (http://facebook.github.io/reac
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react/v16.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Tue, 28 Mar 2023 22:03:14 GMT
|
12
12
|
* Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler)
|
13
13
|
* Global values: `React`
|
14
14
|
|
react v16.14/index.d.ts
CHANGED
@@ -401,7 +401,7 @@ declare namespace React {
|
|
401
401
|
const version: string;
|
402
402
|
|
403
403
|
/**
|
404
|
-
* {@link https://
|
404
|
+
* {@link https://react.dev/reference/react/Profiler#onrender-callback Profiler API}
|
405
405
|
*/
|
406
406
|
type ProfilerOnRenderCallback = (
|
407
407
|
id: string,
|
@@ -449,7 +449,7 @@ declare namespace React {
|
|
449
449
|
* }
|
450
450
|
* ```
|
451
451
|
*
|
452
|
-
* @see https://
|
452
|
+
* @see https://react.dev/reference/react/Component#static-contexttype
|
453
453
|
*/
|
454
454
|
static contextType?: Context<any> | undefined;
|
455
455
|
|
@@ -466,7 +466,7 @@ declare namespace React {
|
|
466
466
|
* declare context: React.ContextType<typeof MyContext>
|
467
467
|
* ```
|
468
468
|
*
|
469
|
-
* @see https://
|
469
|
+
* @see https://react.dev/reference/react/Component#context
|
470
470
|
*/
|
471
471
|
// TODO (TypeScript 3.0): unknown
|
472
472
|
context: any;
|
@@ -474,7 +474,7 @@ declare namespace React {
|
|
474
474
|
constructor(props: Readonly<P> | P);
|
475
475
|
/**
|
476
476
|
* @deprecated
|
477
|
-
* @see https://reactjs.org/docs/legacy-context.html
|
477
|
+
* @see https://legacy.reactjs.org/docs/legacy-context.html
|
478
478
|
*/
|
479
479
|
constructor(props: P, context: any);
|
480
480
|
|
@@ -498,7 +498,7 @@ declare namespace React {
|
|
498
498
|
state: Readonly<S>;
|
499
499
|
/**
|
500
500
|
* @deprecated
|
501
|
-
* https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
|
501
|
+
* https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
|
502
502
|
*/
|
503
503
|
refs: {
|
504
504
|
[key: string]: ReactInstance
|
@@ -690,8 +690,8 @@ declare namespace React {
|
|
690
690
|
* prevents this from being invoked.
|
691
691
|
*
|
692
692
|
* @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
|
693
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
694
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
693
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
694
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
695
695
|
*/
|
696
696
|
componentWillMount?(): void;
|
697
697
|
/**
|
@@ -704,8 +704,8 @@ declare namespace React {
|
|
704
704
|
* prevents this from being invoked.
|
705
705
|
*
|
706
706
|
* @deprecated 16.3, use componentDidMount or the constructor instead
|
707
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
708
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
707
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
708
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
709
709
|
*/
|
710
710
|
UNSAFE_componentWillMount?(): void;
|
711
711
|
/**
|
@@ -719,8 +719,8 @@ declare namespace React {
|
|
719
719
|
* prevents this from being invoked.
|
720
720
|
*
|
721
721
|
* @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
|
722
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
723
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
722
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
723
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
724
724
|
*/
|
725
725
|
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
|
726
726
|
/**
|
@@ -736,8 +736,8 @@ declare namespace React {
|
|
736
736
|
* prevents this from being invoked.
|
737
737
|
*
|
738
738
|
* @deprecated 16.3, use static getDerivedStateFromProps instead
|
739
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
740
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
739
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
740
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
741
741
|
*/
|
742
742
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
|
743
743
|
/**
|
@@ -749,8 +749,8 @@ declare namespace React {
|
|
749
749
|
* prevents this from being invoked.
|
750
750
|
*
|
751
751
|
* @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
|
752
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
753
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
752
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
753
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
754
754
|
*/
|
755
755
|
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
|
756
756
|
/**
|
@@ -764,8 +764,8 @@ declare namespace React {
|
|
764
764
|
* prevents this from being invoked.
|
765
765
|
*
|
766
766
|
* @deprecated 16.3, use getSnapshotBeforeUpdate instead
|
767
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
768
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
767
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
768
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
769
769
|
*/
|
770
770
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
|
771
771
|
}
|
@@ -910,14 +910,14 @@ declare namespace React {
|
|
910
910
|
* context value, as given by the nearest context provider for the given context.
|
911
911
|
*
|
912
912
|
* @version 16.8.0
|
913
|
-
* @see https://
|
913
|
+
* @see https://react.dev/reference/react/useContext
|
914
914
|
*/
|
915
915
|
function useContext<T>(context: Context<T>/*, (not public API) observedBits?: number|boolean */): T;
|
916
916
|
/**
|
917
917
|
* Returns a stateful value, and a function to update it.
|
918
918
|
*
|
919
919
|
* @version 16.8.0
|
920
|
-
* @see https://
|
920
|
+
* @see https://react.dev/reference/react/useState
|
921
921
|
*/
|
922
922
|
function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
|
923
923
|
// convenience overload when first argument is omitted
|
@@ -925,7 +925,7 @@ declare namespace React {
|
|
925
925
|
* Returns a stateful value, and a function to update it.
|
926
926
|
*
|
927
927
|
* @version 16.8.0
|
928
|
-
* @see https://
|
928
|
+
* @see https://react.dev/reference/react/useState
|
929
929
|
*/
|
930
930
|
function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
931
931
|
/**
|
@@ -936,7 +936,7 @@ declare namespace React {
|
|
936
936
|
* updates because you can pass `dispatch` down instead of callbacks.
|
937
937
|
*
|
938
938
|
* @version 16.8.0
|
939
|
-
* @see https://
|
939
|
+
* @see https://react.dev/reference/react/useReducer
|
940
940
|
*/
|
941
941
|
// overload where dispatch could accept 0 arguments.
|
942
942
|
function useReducer<R extends ReducerWithoutAction<any>, I>(
|
@@ -952,7 +952,7 @@ declare namespace React {
|
|
952
952
|
* updates because you can pass `dispatch` down instead of callbacks.
|
953
953
|
*
|
954
954
|
* @version 16.8.0
|
955
|
-
* @see https://
|
955
|
+
* @see https://react.dev/reference/react/useReducer
|
956
956
|
*/
|
957
957
|
// overload where dispatch could accept 0 arguments.
|
958
958
|
function useReducer<R extends ReducerWithoutAction<any>>(
|
@@ -968,7 +968,7 @@ declare namespace React {
|
|
968
968
|
* updates because you can pass `dispatch` down instead of callbacks.
|
969
969
|
*
|
970
970
|
* @version 16.8.0
|
971
|
-
* @see https://
|
971
|
+
* @see https://react.dev/reference/react/useReducer
|
972
972
|
*/
|
973
973
|
// overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
|
974
974
|
// If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
|
@@ -986,7 +986,7 @@ declare namespace React {
|
|
986
986
|
* updates because you can pass `dispatch` down instead of callbacks.
|
987
987
|
*
|
988
988
|
* @version 16.8.0
|
989
|
-
* @see https://
|
989
|
+
* @see https://react.dev/reference/react/useReducer
|
990
990
|
*/
|
991
991
|
// overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
|
992
992
|
function useReducer<R extends Reducer<any, any>, I>(
|
@@ -1002,7 +1002,7 @@ declare namespace React {
|
|
1002
1002
|
* updates because you can pass `dispatch` down instead of callbacks.
|
1003
1003
|
*
|
1004
1004
|
* @version 16.8.0
|
1005
|
-
* @see https://
|
1005
|
+
* @see https://react.dev/reference/react/useReducer
|
1006
1006
|
*/
|
1007
1007
|
|
1008
1008
|
// I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
|
@@ -1027,7 +1027,7 @@ declare namespace React {
|
|
1027
1027
|
* value around similar to how you’d use instance fields in classes.
|
1028
1028
|
*
|
1029
1029
|
* @version 16.8.0
|
1030
|
-
* @see https://
|
1030
|
+
* @see https://react.dev/reference/react/useRef
|
1031
1031
|
*/
|
1032
1032
|
function useRef<T>(initialValue: T): MutableRefObject<T>;
|
1033
1033
|
// convenience overload for refs given as a ref prop as they typically start with a null value
|
@@ -1042,7 +1042,7 @@ declare namespace React {
|
|
1042
1042
|
* of the generic argument.
|
1043
1043
|
*
|
1044
1044
|
* @version 16.8.0
|
1045
|
-
* @see https://
|
1045
|
+
* @see https://react.dev/reference/react/useRef
|
1046
1046
|
*/
|
1047
1047
|
function useRef<T>(initialValue: T|null): RefObject<T>;
|
1048
1048
|
// convenience overload for potentially undefined initialValue / call with 0 arguments
|
@@ -1055,7 +1055,7 @@ declare namespace React {
|
|
1055
1055
|
* value around similar to how you’d use instance fields in classes.
|
1056
1056
|
*
|
1057
1057
|
* @version 16.8.0
|
1058
|
-
* @see https://
|
1058
|
+
* @see https://react.dev/reference/react/useRef
|
1059
1059
|
*/
|
1060
1060
|
function useRef<T = undefined>(): MutableRefObject<T | undefined>;
|
1061
1061
|
/**
|
@@ -1069,7 +1069,7 @@ declare namespace React {
|
|
1069
1069
|
* `componentDidMount` and `componentDidUpdate`.
|
1070
1070
|
*
|
1071
1071
|
* @version 16.8.0
|
1072
|
-
* @see https://
|
1072
|
+
* @see https://react.dev/reference/react/useLayoutEffect
|
1073
1073
|
*/
|
1074
1074
|
function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
|
1075
1075
|
/**
|
@@ -1079,7 +1079,7 @@ declare namespace React {
|
|
1079
1079
|
* @param deps If present, effect will only activate if the values in the list change.
|
1080
1080
|
*
|
1081
1081
|
* @version 16.8.0
|
1082
|
-
* @see https://
|
1082
|
+
* @see https://react.dev/reference/react/useEffect
|
1083
1083
|
*/
|
1084
1084
|
function useEffect(effect: EffectCallback, deps?: DependencyList): void;
|
1085
1085
|
// NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
|
@@ -1090,7 +1090,7 @@ declare namespace React {
|
|
1090
1090
|
* `useImperativeHandle` should be used with `React.forwardRef`.
|
1091
1091
|
*
|
1092
1092
|
* @version 16.8.0
|
1093
|
-
* @see https://
|
1093
|
+
* @see https://react.dev/reference/react/useImperativeHandle
|
1094
1094
|
*/
|
1095
1095
|
function useImperativeHandle<T, R extends T>(ref: Ref<T>|undefined, init: () => R, deps?: DependencyList): void;
|
1096
1096
|
// I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
|
@@ -1100,7 +1100,7 @@ declare namespace React {
|
|
1100
1100
|
* has changed.
|
1101
1101
|
*
|
1102
1102
|
* @version 16.8.0
|
1103
|
-
* @see https://
|
1103
|
+
* @see https://react.dev/reference/react/useCallback
|
1104
1104
|
*/
|
1105
1105
|
// TODO (TypeScript 3.0): <T extends (...args: never[]) => unknown>
|
1106
1106
|
function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;
|
@@ -1108,7 +1108,7 @@ declare namespace React {
|
|
1108
1108
|
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
|
1109
1109
|
*
|
1110
1110
|
* @version 16.8.0
|
1111
|
-
* @see https://
|
1111
|
+
* @see https://react.dev/reference/react/useMemo
|
1112
1112
|
*/
|
1113
1113
|
// allow undefined, but don't make it optional as that is very likely a mistake
|
1114
1114
|
function useMemo<T>(factory: () => T, deps: DependencyList | undefined): T;
|
@@ -1119,7 +1119,7 @@ declare namespace React {
|
|
1119
1119
|
* It’s most valuable for custom hooks that are part of shared libraries.
|
1120
1120
|
*
|
1121
1121
|
* @version 16.8.0
|
1122
|
-
* @see https://
|
1122
|
+
* @see https://react.dev/reference/react/useDebugValue
|
1123
1123
|
*/
|
1124
1124
|
// the name of the custom hook is itself derived from the function name at runtime:
|
1125
1125
|
// it's just the function name without the "use" prefix.
|
react v16.14/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "16.14.
|
3
|
+
"version": "16.14.37",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -146,7 +146,7 @@
|
|
146
146
|
"@types/scheduler": "*",
|
147
147
|
"csstype": "^3.0.2"
|
148
148
|
},
|
149
|
-
"typesPublisherContentHash": "
|
149
|
+
"typesPublisherContentHash": "dd77913719e6bcc6b8c9e86b9023186834fdb40cd543a7c534c8d676d5ec6dd5",
|
150
150
|
"typeScriptVersion": "4.3",
|
151
151
|
"exports": {
|
152
152
|
".": {
|