Skip to content

Commit 880f69a

Browse files
authored
add Partial caveat
1 parent 6803d54 commit 880f69a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,14 @@ const partialStateUpdate = (obj: Partial<typeof state>) => setState({...state, .
811811
partialStateUpdate({foo: 2}) // this works
812812
```
813813
814+
<details>
815+
<summary>
816+
Minor caveats on using <pre>Partial</pre>
817+
</summary>
818+
819+
Note that there are some TS users who don't agree with using `Partial` as it behaves today. See [subtle pitfalls of the above example here](https://twitter.com/ferdaber/status/1084798596027957248), and check out this long discussion on [why @types/react uses Pick instead of Partial](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365).
820+
</details>
821+
814822
# Troubleshooting Handbook: TSLint
815823
816824
Sometimes TSLint is just getting in the way. Judicious turning off of things can be helpful. Here are useful tslint disables you may use:

0 commit comments

Comments
 (0)