Open amannn opened 1 year ago
I believe it's this todo in the code base: https://github.com/kripod/react-polymorphic-types/blob/30ba44854a4edec6dcb5ae797c6df4e849ab73db/index.d.ts#L25
A component passed to as
shouldn’t have any required props. Otherwise, specifying a generic component should be possible using a different approach for polymorphism as shown here.
I've got a polymorphic button component that looks like this:
Simple cases work:
… but when I pass a component to the
as
prop that is itself generic, I get an error.Can you provide some help for this use case @kripod? Thank you very much!