Skip to content

[Advanced] AS prop example updated to accept element specific props #151

Closed
@sami616

Description

@sami616

It would be awesome if the example was updated so that the accepted props changed depending on what as prop was passed. For example. Passing as='button' and then passing a href prop would result in a compiler error. I've been trying to figure out how to do this but not had much luck!

Here's an incomplete attempt: https://stackoverflow.com/questions/58200824/generic-react-typescript-component-with-as-prop-able-to-render-any-valid-dom

🤔😫

Metadata

Metadata

Assignees

No one assigned

    Labels

    ADVANCEDAdvanced CheatsheetwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions