Trey Shugart
Trey Shugart
https://github.com/webcomponents/react-integration will create a React component from a web component constructor and give you custom event support.
> I'd like it better if we could just pass through all props to element properties but it seems like that ship has sailed since most web components aren't designed...
@sebmarkbage I like that approach but I think there are a few things to consider (and you're probably already aware): 1. Props don't work for all elements. `SVGElement` will error...
Looks awesome! I'll reiterate that https://github.com/webcomponents/react-integration currently solves this stuff in userland. That might be a good spot to start collaborating on some of the boilerplate.
+1 for just `events` I am curious, though, as to how React will decide how it should set props on an element, as opposed to attributes. This could be troublesome...
> A name as generic as events could easily be used by say, a web component to accept a list of calendar events to display. This is exactly why we're...
@dantman that's a good point. I like the symbol suggestion. @justinfagnani I agree it's extra code and that's what I dislike about it. As for 2, that's a given; I...
@joeldenning `customElements.whenDefined()` accepts a [name argument](https://www.w3.org/TR/custom-elements/#custom-elements-api) for the custom element you're checking for, so React would not only have to know the name of it, but also that it is...
Wanted to give an update to a proof of concept that helps to solve this problem. I linked to it in https://github.com/facebook/react/issues/7249#issuecomment-282913008, but here's the [gist](https://gist.github.com/treshugart/2fb509a8828adf7fee5245bfa2a54ba7) for convenience.
@matthewrobb Hmm, in trying to explain the rationale, it doesn't really fit this use case. Yet, maybe. I wanted to have a place to do this https://gist.github.com/treshugart/e19c2be255448cd31d261f2e8db2127c#file-example-js-L8, but that feels...