-
Notifications
You must be signed in to change notification settings - Fork 1k
[labs/react] Fix type compatibility with Preact when adding children #4142
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
Conversation
🦋 Changeset detectedLatest commit: 5bfa53e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultsthis-change
render
update
update-reflect
this-change, tip-of-tree, previous-release
render
update
nop-update
this-change, tip-of-tree, previous-release
render
update
this-change, tip-of-tree, previous-release
render
update
update-reflect
|
AndrewJakubowicz
left a comment
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.
LGTM
It might be nice to land the Preact example, then land this with the children added to the example, but not too fussed with order.
Great stuff!
e3a7f34 to
5bfa53e
Compare
|
Rebased off of main with preact example merged, and addressed TODO that adds an element child to the wrapped component. Type test for it is passing. https://github.com/lit/lit/actions/runs/6005198623/job/16287421462?pr=4142#step:8:305 |
Fixes #4138
Content placed in children position in JSX are typed differently depending on whether it's React or Preact project. Children typing in Preact projects were incompatible with
childrenprop of our wrapped components as they only acceptedReact.ReactNodewhich was more restrictive than what Preact considers as valid renderable child.This PR adds children typing that's compatible with both React and Preact.
Testing for this fix working in Preact was done manually in a working branch for #4111. I'd be okay with holding off on merging this until I can do the updates to that branch to demonstrate the fix.Mentioned PR has been merged and this branch has been rebased to that.