Skip to content

Commit 282aa18

Browse files
prigaraandrewbranch
authored andcommitted
Removed deprecation warning for React context (DefinitelyTyped#39177)
1 parent 9207eeb commit 282aa18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

types/react/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ declare namespace React {
417417
/**
418418
* If using the new style context, re-declare this in your class to be the
419419
* `React.ContextType` of your `static contextType`.
420+
* Should be used with type annotation or static contextType.
420421
*
421422
* ```ts
422423
* static contextType = MyContext
@@ -426,8 +427,7 @@ declare namespace React {
426427
* declare context: React.ContextType<typeof MyContext>
427428
* ```
428429
*
429-
* @deprecated if used without a type annotation, or without static contextType
430-
* @see https://reactjs.org/docs/legacy-context.html
430+
* @see https://reactjs.org/docs/context.html
431431
*/
432432
// TODO (TypeScript 3.0): unknown
433433
context: any;

0 commit comments

Comments
 (0)