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 7194ae9 commit d731a4cCopy full SHA for d731a4c
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