Bento Tracking Issue: React/Preact compatibility
See original GitHub issueDescription
There are some nuances in React and Preact compatibility we need to address to ensure our Bento components written in Preact are well built in React for their releases. At the very least, there should be no warnings when running our components in React development mode. This is a tracking issue for the effort in doing so.
-
react.Fragment
andpreact.Fragment
are not the same type - #35412 - Do not pass unneeded DOM attributes/props - #35553
- Use of
className
(React build) andclass
(Preact builds) #35722 - Use of
tabIndex
preferred totabindex
#35722 - Use of
props.children
should use the Children API inpreact/compat
where relevant #36154 - camelCase SVG props inside of JSX for React builds and kebab-case for Preact builds #35722
- Use of
onInput
andonChange
- Use of
onDblClick
andonDoubleClick
- Registered events are supported via GlobalEventHandlers and SyntheticEvents
- Pass correctly typed values to DOM, i.e.
rtl="false"
preferred tortl={false}
- #35696
Alternatives Considered
n/a
Additional Context
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Differences to React - Preact
For both preact and preact/compat, version compatibility is measured against the current and previous major releases of React.
Read more >Untitled
Free download track of nepali songs, Faja postparto coppel, Emailing the ... Bibio silver wilkinson mp3, Broken gameshark, Hypermotard 796 problems, ...
Read more >Get started | bentojs.dev
Bento components are fundamentally React functional components, released as Preact or React, and in regular or minified builds. Install each Bento component as ......
Read more >Pascal Birchler - Just Another WordPress Enthusiast
Using Bento Components for Gutenberg Block Development ... as custom elements, but also as React and Preact components with the same features and...
Read more >react - ABC Developer Blog
Posts about react written by Julian Fell, Tim Holt, and Simon Schwartz. ... The obvious use-case is to switch it out for an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Chatted with @caroqliu offline - we decided that using React syntax with
preact/compat
to ensure Preact compatibility would be a better fix than adding a build step. No performance issues in using the plugin because it is already being imported.Back to @caroqliu for next steps?
Thanks for performing the analysis here, Alan.
I assume it would be a change on the
preact-preferred-props
lint rule, which currently enforces an non-exhaustive set into Preact style, and could be modified to prefer React-style.