adobe / react-webcomponent

This projects automates the wrapping of a React component in a CustomElement.
Apache License 2.0
105 stars 19 forks source link

Only inline styles are supported? #22

Closed AndreyLuzinov closed 4 years ago

AndreyLuzinov commented 4 years ago

AFAIU this solution will work with shadow-dom only in case of inline styles?

AndreyLuzinov commented 4 years ago

I think it should be an optional parameter to pass styles or link ref into webcomponent while creation.

alexmirea commented 4 years ago

Hi @AndreyLuzinov. Currently we support only rendering the component in the shadow root. So if you want to add styles only inline styles on the element will work.

You are right, we don't support yet <style/> or a link ref, for that we need to pass extra parameters here https://github.com/adobe/react-webcomponent/blob/master/lib/WebComponent.js#L142.

Could you please open a separate issue detailing the problem more formally, and we can discuss what the best solution would be.