Skip to content
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

Web component attributes not getting passed down #7

Closed
mnemanja opened this issue Feb 27, 2018 · 5 comments
Closed

Web component attributes not getting passed down #7

mnemanja opened this issue Feb 27, 2018 · 5 comments

Comments

@mnemanja
Copy link
Contributor

mnemanja commented Feb 27, 2018

How are attributes envisioned to be passed to the react component?
Are you perhaps using events to pass data to your web component rather than via event or attributes?

For example I could use lifecycle event webComponentConstructed and get the web component as a dom element there, and then do something like this:

webComponentConstructed(el) {
  console.log(el.attributes); // Returns an array of attributes
}

But could this be passed to react components props instead? I think it would make for a nicer integration.

Do you think this makes sense?

@eriklharper
Copy link

Also think that this is a very less-than-ideal way to work with the custom element attributes. Would be great if we could figure out a way to have these attrs pass down as props to the component.

@ctestama
Copy link

We're having the same issue. We want to create a bundle where our react components are registered as web components, however the props will not be known at bundle-time. I've also looked at this library: https://www.npmjs.com/package/web-react-components

That one passes the attributes to props just fine. It does not work with CSS modules though, while this module does. Not sure which would be the greater effort, to add the feature talked about here, or modify web-react-components to work with react-web-component-style-loader.

@dsuwirya
Copy link

It's been almost a year, is there any plan to fix this - please? This is very much needed. Thanks.

@caugello
Copy link

@LukasBombach any plans for this in the near future ?

@mnemanja
Copy link
Contributor Author

mnemanja commented Apr 8, 2020

Looks like this project has been dead for couple of years now.

@mnemanja mnemanja closed this as completed Apr 8, 2020
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

No branches or pull requests

5 participants