Skip to content

Commit 4665ec5

Browse files
author
splouk
committed
use DeepReadonly
1 parent d097fd7 commit 4665ec5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

types/react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"private": true,
33
"dependencies": {
4-
"csstype": "^3.0.2"
4+
"csstype": "^3.0.2",
5+
"utility-types": "^3.10.0"
56
},
67
"exports": {
78
".": {

types/react/v17/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import * as CSS from 'csstype';
3535
import * as PropTypes from 'prop-types';
3636
import { Interaction as SchedulerInteraction } from 'scheduler/tracing';
37+
import { DeepReadonly } from "utility-types";
3738

3839
type NativeAnimationEvent = AnimationEvent;
3940
type NativeClipboardEvent = ClipboardEvent;
@@ -918,15 +919,15 @@ declare namespace React {
918919
* @version 16.8.0
919920
* @see https://reactjs.org/docs/hooks-reference.html#usestate
920921
*/
921-
function useState<S>(initialState: S | (() => S)): [Readonly<S>, Dispatch<SetStateAction<S>>];
922+
function useState<S>(initialState: S | (() => S)): [DeepReadonly<S>, Dispatch<SetStateAction<S>>];
922923
// convenience overload when first argument is omitted
923924
/**
924925
* Returns a stateful value, and a function to update it.
925926
*
926927
* @version 16.8.0
927928
* @see https://reactjs.org/docs/hooks-reference.html#usestate
928929
*/
929-
function useState<S = undefined>(): [Readonly<S> | undefined, Dispatch<SetStateAction<S | undefined>>];
930+
function useState<S = undefined>(): [DeepReadonly<S> | undefined, Dispatch<SetStateAction<S | undefined>>];
930931
/**
931932
* An alternative to `useState`.
932933
*

0 commit comments

Comments
 (0)