polymorphic-react-component
polymorphic-react-component copied to clipboard
Companion repo for my build a polymorphic React component class
Firstly, thank you for an amazing and very thorough tutorial on logrocket! I've followed the tutorial, and had this error on the `Text` compomnent: ``` Type 'ForwardRefExoticComponent' is not assignable...
Thank you for your excellent tutorial. I'm still new to Typescript. I'm not sure how to write a component that wraps my Polymorphic created using your tutorial. Lets call the...
Hi, I was following your [tutorial](https://www.freecodecamp.org/news/build-strongly-typed-polymorphic-components-with-react-and-typescript/) Everything went perfectly, but I'm facing one slight problem. When I try to pass `as="input"` and use `onChange={(event) => ...}` It throws error: `Parameter...
Hello, Thanks providing such a helpful example. It has greatly assisted me in the process of migrating our components that utilize polymorphic props from JavaScript to TypeScript. Specifically, our components...
Is there a way we can limit the element type to for eg: `Button` and `a`? Been trying to use this helper but I want to narrow it down in...
Hei. First of all thanks for the great example! But I am struggling to figure out how to use the polymoprhic component props in another components array prop. I created...
Copying final code gives me following error: `'Component' cannot be used as a JSX component. Its element type 'Component | ReactElement | null' is not a valid JSX element. Type...
Thanks for this awesome article on logrocket. I tried wrapping my component with memo, but it breaks the typing. Can you please advise? ``` import { memo, type ComponentPropsWithoutRef, type...