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
[labs/react] Fix style attribute conflicts with the type definition of DOM and ReactModule #3048
Conversation
…nition of dom and React Fixed lit#3021
🦋 Changeset detectedLatest commit: e20b798 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @indigostar-kr !
We'll need some tests here that show we get a build error without the fix. Can you make a test that contains JSX with a style binding? We have one in the tests already with a cast to any
, so hopefully that can be removed.
@@ -143,7 +143,7 @@ export const createComponent = <I extends HTMLElement, E extends Events>( | |||
// 'children', but 'children' is special to JSX, so we must at least do that. | |||
type UserProps = React.PropsWithChildren< | |||
React.PropsWithRef< | |||
Partial<Omit<I, 'children'>> & | |||
Partial<Omit<I, 'children' | 'style' | 'ref' | 'key'>> & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add className
here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that both class and className should be included.
I'll check the test code and see if I can write it. |
…ties when react properties
This PR might be resolved with #3072 :) curious if that can be confirmed |
resolved with #3072 |
oops thought this was an issue my bad, reopened |
Style that conflicts with children, ref, and key, which are reserved words in React, is omitted from the properties of the web component.
Fixes [labs/react] createComponent React component style property typescript problem #3021
Added a default value for the type because if no Events were dispatched I got the following error: