mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
feat(react): add StrictMode definition (#24629)
This commit is contained in:
Vendored
+3
-1
@@ -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 <https://asana.com>
|
||||
// AssureSign <http://www.assuresign.com>
|
||||
@@ -16,6 +16,7 @@
|
||||
// Josh Rutherford <https://github.com/theruther4d>
|
||||
// Guilherme Hübner <https://github.com/guilhermehubner>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Johann Rakotoharisoa <https://github.com/jrakotoharisoa>
|
||||
// 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;
|
||||
|
||||
//
|
||||
|
||||
@@ -89,6 +89,13 @@ const StatelessComponentWithoutProps: React.SFC = (props) => {
|
||||
</React.Fragment>
|
||||
</div>;
|
||||
|
||||
// Strict Mode
|
||||
<div>
|
||||
<React.StrictMode>
|
||||
<div />
|
||||
</React.StrictMode>
|
||||
</div>;
|
||||
|
||||
// Below tests that setState() works properly for both regular and callback modes
|
||||
class SetStateTest extends React.Component<{}, { foo: boolean, bar: boolean }> {
|
||||
handleSomething = () => {
|
||||
|
||||
Reference in New Issue
Block a user