Skip to content

Commit

Permalink
one more
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Oct 2, 2023
1 parent 5b112b3 commit 18fc7cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/advanced/patterns_by_usecase.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Parent.propTypes = {

The thing you cannot do is **specify which components** the children are, e.g. If you want to express the fact that "React Router `<Routes>` can only have `<Route>` as children, nothing else is allowed" in TypeScript.

This is because when you write a JSX expression (`const foo = <MyComponent foo='foo' />`), the resultant type is blackboxed into a generic `React.JSX.Element` type. (_[thanks @ferdaber](https://github.com/typescript-cheatsheets/react/issues/271)_)
This is because when you write a JSX expression (`const foo = <MyComponent foo='foo' />`), the resultant type is blackboxed into a generic React.JSX.Element type. (_[thanks @ferdaber](https://github.com/typescript-cheatsheets/react/issues/271)_)

## Type Narrowing based on Props

Expand Down

0 comments on commit 18fc7cb

Please sign in to comment.