DEV Community 👩‍💻👨‍💻

Ali Abbas
Ali Abbas

Posted on • Updated on

React vs Preact?

For a small project that needa blazing fast speed, which to prefer.

  • MOON

Top comments (12)

vonheikemen profile image

Blazing fast in what sense? Creating nodes, Updating the ui, bundle size?

Both Preact and React are fast enough.

I will choose Preact, because is 3kb.

But if you want to use hooks with preact you have to install an unstable version preact@next because the stable version doesn't have them.

solarliner profile image
🇨🇵️ Nathan Graule

Preact entered beta a few weeks ago, and so far it's been quite stable. I'm using it for 2 projects - nothing to report bar one quirky TypeScript typing.

itsjzt profile image
Saurabh Sharma

I would say start with react and eject when you find preact is actually making your app faster.

maheshkay profile image
Mahesh K

Preact, definitely. I'd say you can also use react with better CDN for serving media elements. If that's something you are planning on using.

anpos231 profile image

Inferno ;P

andrewbrown profile image
Andrew Brown 🇨🇦


Pr/React is garbage

yaser profile image
Yaser Al-Najjar • Edited on

We have tried mithril before and it was quite frustrating... Lemme tell you the story

We wanted a simple framework for SPA, esp. once we saw that Flarum was quitely amazing done using mithril.

We started using it, but problems started to appear...
Docs are good but once you run into problems they're not enough, and ooops not many people use mithril and StackOverflow has not much on it; so, we were on our own.

That was a bit okay until we realized there was an issue in mithril itself (can't remember what it was), and the issue was discussed on github, it took about two weeks till they fixed it 🙄

I know it's an opensource thing but we couldn't afford with pull requesting the fixes to mithril cuz we needed speed... For financial reasons.

For our team that was it, we moved into Vue.js cuz of the small learning curve and the popularity... we can't be happier since then.

andrewbrown profile image
Andrew Brown 🇨🇦

Its a story with of holes. I don't doubt it may have been frustrating.

It depends on what version of Mithril you were using when you say X didn't work. Before version 1 you had to be comfortable understanding the underlying architecture of web-frameworks.

I can build my own web-framework in a weekend so my perception of easy may be skewed.

What I like about mithril codebase is its an incredibly small and sane framework.

I can open it up read, repair and debug any problem that I could have and I can't say the same for Vue, Angular or React.

Sadly Mithril will be a footnote because the developer ecosystem and plugins are not there.

Vue I would say is the framework I hate the most.
Vue does not play well with Typescript
Vue is painful to turn into isomorphic javascript.
The quality and consistency of their plugins are terrible (looking at you Axios).
Vue architectural choices makes it poor for automation.

Angular I would say is the framework that is most productive, convention and well documented. I don't care for its size or how it bought into some of the concepts that React purports as what needs to be in a web-framework but you can't win them all.

I am cursed with all this web-framework knowledge and so I tend to avoid web-frameworks all together.

sarneeh profile image
Jakub Sarnowski

Could you elaborate on this opinion? I was considering using Preact in the next project and would like to know more :)

realabbas profile image
Ali Abbas Author

Moonjs is good as well.

andrewbrown profile image
Andrew Brown 🇨🇦

First time heard of Moonjs. You learn something new every day

Thread Thread
steinskeeper profile image

You hear about new frameworks every day. It's more like looking at different boxes of morning cereal xD

Now it's your turn.

🗒 Share a tutorial
🤔 Reflect on your coding journey
❓ Ask a question
Create an account to join hundreds of thousands of DEV members on their journey.