mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add types for the proposed Hooks API
* Add missing parameter
* Add a comment to SetStateAction
* A context's Consumer is also a valid argument to useContext
* Added tests for React hooks.
* Better names, correct types, add a usage note to useMemo
* Add some crazy test that uses every hook
* Fix tests not passing in TS < 3.1
* Fix the factory in useImperativeMethods affecting the T parameter
Adds a second type parameter to prevent TypeScript from just refining T
to {} if the result of the callback is a supertype of the ref's type.
* Add a convenience overload for useRef that are initialized with null
* Add another TS 3.0 TODO comment
* Return immutable ref object from useRef<T>(T|null) to prevent misuse
If you need the ref to be mutable just pass <T|null> as the generic argument.
* Update comment about EffectCallback
29 lines
636 B
JSON
29 lines
636 B
JSON
{
|
|
"files": [
|
|
"index.d.ts",
|
|
"test/index.ts",
|
|
"test/tsx.tsx",
|
|
"test/cssProperties.tsx",
|
|
"test/managedAttributes.tsx",
|
|
"test/hooks.tsx"
|
|
],
|
|
"compilerOptions": {
|
|
"module": "commonjs",
|
|
"lib": [
|
|
"es6"
|
|
],
|
|
"noImplicitAny": true,
|
|
"noImplicitThis": false,
|
|
"strictNullChecks": true,
|
|
"strictFunctionTypes": false,
|
|
"baseUrl": "../",
|
|
"typeRoots": [
|
|
"../"
|
|
],
|
|
"types": [],
|
|
"noEmit": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"jsx": "preserve"
|
|
}
|
|
}
|