Skip to content

Commit

Permalink
Update patterns_by_usecase.md
Browse files Browse the repository at this point in the history
  • Loading branch information
swyxio authored Mar 8, 2022
1 parent c0e70bd commit 5e08944
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/advanced/patterns_by_usecase.md
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,10 @@ function isString(a: unknown): a is string {

[Read more about User-Defined Type Guards in the Handbook](https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards).

### Narrowing using `extends`

See this quick guide: https://twitter.com/mpocock1/status/1500813765973053440?s=20&t=ImUA-NnZc4iUuPDx-XiMTA

## Props: One or the Other but not Both

Use the `in` keyword, function overloading, and union types to make components that take either one or another sets of props, but not both:
Expand Down

0 comments on commit 5e08944

Please sign in to comment.