Preact implementation
See original GitHub issueWould you like it to be part of this repository? It’s very similar to slate-react
.
Even if that’s not the case, I think it’s worth considering to move non-React specific code (constants, utils, even plugins) to separate package (e.g. slate-dom
?) because you’d reuse most of it with every DOM view integration (libraries or DIY) if you port or get inspiration from slate-react
.
Diffs in utils
:
- Eliminate
ReactDOM.findDOMNode
which is deprecated anyway (in strict mode) #2420. There are two identical instances here and here (which could be replaced witheditor.base
?).ReactDOM
is also used in this utility function but it’s not even used in package nor exported.
Diffs in components
:
- This has to be changed to
{[...children]}
, ImmutableJS quirk? Preactchildren
has to be regular array (Immer!!). Im not 100% sure if there are other similar cases but everything works so far. - Replace
React.Component
withPreact.Component
(also inplugins/react.js
).
Not sure if there are any clashes between Preact’s native events and code that’s written for React’s synthetic events (signature is the same…) but everything I’ve tried works so far and I haven’t encountered any errors.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Preact | Preact: Fast 3kb React alternative with the same ES6 ...
It's one of the fastest Virtual DOM libraries out there, thanks to a simple and predictable diff implementation. We automatically batch updates and...
Read more >Planning for PreACT
This guide provides you with the tools you will need to successfully implement PreACT. PreACT Information Sheet. ▫ View the information sheet for...
Read more >Introduction to Preact : A smaller, faster React alternative
It's one of the fastest Virtual DOM libraries out there, thanks to a simple and predictable diff implementation. Preact aims to deliver on...
Read more >AshKyd/ui95: WIP: A preact implementation of Windows 95/98 ...
WIP: A preact implementation of Windows 95/98/ME style components and apps. See it in action on my personal site at https://ash.ms - GitHub...
Read more >Intro | Testing Library
Preact Testing Library on GitHub. ... You want to write tests for your Preact components so that they avoid including implementation details ...
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 FreeTop 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
Top GitHub Comments
@realknack yup,
preact/compat
is meant to work exactly like react, even though we may do things differently under the hood. If something doesn’t work like react we treat it as a bug inpreact/compat
. I went ahead and made an issue.@marvinhagemeister
Thanks for taking the time to write this. I already did put this project on hold until X release. Can’t wait! ☕