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

Doesn't work with web components with style attributes #188

Closed
sinchang opened this issue Dec 11, 2020 · 3 comments · Fixed by #193 · May be fixed by peterclemenko/react-digraph#9
Closed

Doesn't work with web components with style attributes #188

sinchang opened this issue Dec 11, 2020 · 3 comments · Fixed by #193 · May be fixed by peterclemenko/react-digraph#9
Assignees
Labels
bug Something isn't working

Comments

@sinchang
Copy link

sinchang commented Dec 11, 2020

Expected Behavior

render web component correctly

Actual Behavior

throw error on build

Reproducible Demo

https://codesandbox.io/s/html-react-parser-forked-vll1t

Environment

@remarkablemark
Copy link
Owner

remarkablemark commented Dec 12, 2020

I can confirm that this error for Web Components occurs even in React v15:

Error: The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.

I will work on a fix to ensure that attributesToProps will transform style string into an object for custom elements.

@remarkablemark
Copy link
Owner

@sinchang Please review PR #193

@remarkablemark
Copy link
Owner

Published 0.14.3:

npm:

Yarn:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants