Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add JSX IntrinsicElement types #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

keithamus
Copy link
Contributor

This adds the JSX.IntrinsicElement types to the define files. Closes #163

@keithamus keithamus requested a review from a team as a code owner November 23, 2022 18:57
@primer-css
Copy link

👋 Hello and thanks for pinging us! This issue or PR has been added to our inbox and a Design Infrastructure first responder will review it soon.

  • 🎨 If this is a PR that includes a visual change, please make sure to add screenshots in the description or deploy this code to a lab machine with instructions for how to test.
  • If this is a PR that includes changes to an interaction, please include a video recording in the description.
  • ⚠️ If this is urgent, please visit us in #primer on Slack and tag the first responders listed in the channel topic.

Copy link

@JoshBowdenConcepts JoshBowdenConcepts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for @github/primer-reviewers

@koddsson
Copy link
Contributor

Are we planning to auto-generate these in the future? I think that could be cool with the Custom Element Manifest if possible. Then it should be trivial to add other bindings for other frameworks as well and we don't have to manually maintain these bindings.

@keithamus
Copy link
Contributor Author

Experimenting with this a bit, this is untenable. React requires a type that includes references to the React library itself, which we're not prepared to bring into this custom element.

declare global {
  namespace JSX {
    interface IntrinsicElements {
      'relative-time': React.DetailedHTMLProps<React.HTMLAttributes<RelativeTimeElement>, RelativeTimeElement>
    }
  }
}

This should be defined in consuming libraries if they want to use this in React.

@keithamus keithamus closed this Nov 24, 2022
@keithamus keithamus deleted the add-jsx-intrinsicelement-types branch November 24, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add better jsx support
4 participants