We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a6e604 commit af2cabbCopy full SHA for af2cabb
README.md
@@ -439,7 +439,15 @@ export interface Props {
439
440
## Hooks
441
442
-*Not written yet.*
+Hooks are supported in `@types/react` from v16.7 up.
443
+
444
+Many hooks are initialized with null-ish default values, and you may wonder how to provide types. Do this:
445
446
+```tsx
447
+const [user, setUser] = useState<IUser | null>(null);
448
+```
449
450
+If you are writing a React Hooks library, don't forget that you can also expose
451
452
[Something to add? File an issue](https://github.com/sw-yx/react-typescript-cheatsheet/issues/new).
453
0 commit comments