From 5a3e0b2f34ea208b7355e75b048d159bfe5735b5 Mon Sep 17 00:00:00 2001 From: Joha2n Date: Mon, 2 Apr 2018 12:59:11 +0200 Subject: [PATCH] feat(react): add StrictMode definition (#24629) --- types/react/index.d.ts | 4 +++- types/react/test/tsx.tsx | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c38f57b0a7..96c23cded3 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React 16.1 +// Type definitions for React 16.3 // Project: http://facebook.github.io/react/ // Definitions by: Asana // AssureSign @@ -16,6 +16,7 @@ // Josh Rutherford // Guilherme Hübner // Josh Goldberg +// Johann Rakotoharisoa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -268,6 +269,7 @@ declare namespace React { const Children: ReactChildren; const Fragment: ComponentType; + const StrictMode: ComponentType; const version: string; // diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 7fa151fd29..a9ce5138de 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -89,6 +89,13 @@ const StatelessComponentWithoutProps: React.SFC = (props) => { ; +// Strict Mode +
+ +
+ +
; + // Below tests that setState() works properly for both regular and callback modes class SetStateTest extends React.Component<{}, { foo: boolean, bar: boolean }> { handleSomething = () => {