Typescript: Support `use` component prop types on the base component
See original GitHub issueAt the moment, if we try to compose two components via the use
prop. The component specified via use
will not spread its TS types on the root component. Thus, the following will produce a typescript error on the href
prop:
<Button use={Link} href="https://example.com">Go to Example</Button>
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Typechecking With PropTypes - React
PropTypes exports a range of validators that can be used to make sure the data you receive is valid. In this example, we're...
Read more >Typing Component Props - React TypeScript Cheatsheets
Basic Prop Types Examples. A list of TypeScript types you will likely use in a React+TypeScript app: type AppProps = { message: string;...
Read more >Typescript React: Access component property types
Show activity on this post. here we have to declare types for component props and state (in type variables). After we declared that...
Read more >Build strongly typed polymorphic components with React and ...
Learn how to build strongly typed polymorphic React components with TypeScript, using familiar Chakra UI and MUI component props as guides.
Read more >propTypes vs typescript types in React components - Medium
Supports only a limited set of types and sometimes writing a complex type can be hard with prop types and you might need...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Go for it
Yeah, I just put together my own work-around:
Instead of: