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

[labs/react] Fix style attribute conflicts with the type definition of DOM and ReactModule #3048

Closed
wants to merge 2 commits into from

Conversation

indigostar-kr
Copy link

'{ children: string; "data-testid": string; appearance: any; }' 형식은 'Partial<EventProps<Events>>' 형식에 할당할 수 없습니다.
  'children' 속성이 인덱스 시그니처와 호환되지 않습니다.
    'string' 형식은 '(e: Event) => void' 형식에 할당할 수 없습니다.ts(2322)

@changeset-bot
Copy link

changeset-bot bot commented Jun 16, 2022

🦋 Changeset detected

Latest 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

@indigostar-kr indigostar-kr changed the title fix(lit-labs/react): Fix style attribute conflicts with the type defi… [@labs/react] Fix style attribute conflicts with the type definition of DOM and ReactModule Jun 16, 2022
@indigostar-kr indigostar-kr marked this pull request as ready for review June 16, 2022 06:08
@justinfagnani justinfagnani changed the title [@labs/react] Fix style attribute conflicts with the type definition of DOM and ReactModule [labs/react] Fix style attribute conflicts with the type definition of DOM and ReactModule Jun 16, 2022
Copy link
Collaborator

@justinfagnani justinfagnani left a 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'>> &
Copy link
Collaborator

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?

Copy link
Author

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.

@indigostar-kr
Copy link
Author

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.

I'll check the test code and see if I can write it.

@taylor-vann
Copy link
Contributor

This PR might be resolved with #3072

:) curious if that can be confirmed

@taylor-vann
Copy link
Contributor

resolved with #3072

@taylor-vann taylor-vann reopened this Aug 25, 2022
@taylor-vann
Copy link
Contributor

oops thought this was an issue my bad, reopened

@taylor-vann
Copy link
Contributor

closing as resolved by #3128 and #3163

@indigostar-kr indigostar-kr deleted the feature/fix-react-style branch November 15, 2022 22:57
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

Successfully merging this pull request may close these issues.

[labs/react] createComponent React component style property typescript problem
3 participants