4 ms·
Sites looking to use jQuery most likely aren't doing much more than a few event handlers and an interactive component here or there. In those cases, I'd argue
by hajile 6y ago
Sites looking to use jQuery most likely aren't doing much more than a few event handlers and an interactive component here or there.
In those cases, I'd argue pReact is superior. It's almost 10x smaller (29kb vs 3.5kb gzipped). It's faster and more structured leading to less maintenance cost and more code reuse. If you use hyperscript, there's also no JSX compilation required.
- hu3 6y agoI'd like to learn about usage of preact with hyperlink or similar. Do you know of a repo I can take a look?
- hajile 6y agoI think that's hard to ascertain because it's a drop-in replacement for react. I assume you mean hyperapp instead of hyperlink. It gets around a half-million downloads per week according to NPM stats while hyperapp gets under 3k per week.
- hu3 6y agoYes. Or hyperscript as my parent posted. I'd love to see an example of preact with it. But looking at the repo https://github.com/hyperhype/hyperscript https://github.com/hyperhype/hyperscript I have a hard time imagining how preact can work together. They seem to overlap in functionality.
- hajile 6y agoYou can either use their native `h` (basically createElement in React) https://preactjs.com/guide/v10/tutorial/ https://preactjs.com/guide/v10/tutorial/ or you can use the full hyperscript markup library https://github.com/queckezz/preact-hyperscript https://github.com/queckezz/preact-hyperscript