Using Preact Instead Of React

https://developit.github.io/preact-perf/
  1. How easy it was to swap React w/ Preact.
  2. If it all the features in my app that use other libs like redux, redux-forms and so on, still work.
  3. How much smaller the overall size reduces.
  4. How much better it performs

Here are the results:

1. How easy it was to swap React w/ Preact.

  1. npm install -save preact preact-compat
  2. Add alias like below:

2. If all the features in my app still work

3. How much smaller the app became?

React
Preact

4. How much better my app performs

BONUS:

  1. Preact is so small, you can actually read its code much more easily than React’s! It’s pretty cool!
  2. Preact comes with some nifty features like Linked State and so on.

CAUTION:

  1. Make sure to test your app thoroughly before switching over.

My Other Posts

React Performance:

  1. Two Quick Ways To Reduce React App’s Size In Production
  2. Using Preact Instead Of React
  3. The Inner Workings Of Virtual DOM (With Lots Of Pictures)

Functional Programming

  1. JavaScript Is Turing Complete — Explained
  2. Functional Programming In JS — With Practical Examples (Part 1)
  3. Functional Programming In JS — With Practical Examples (Part 2)
  4. Why Redux Need Reducers To Be “Pure Functions”

ES6

  1. 5 JavaScript “Bad” Parts That Are Fixed In ES6
  2. Is “Class” In ES6 The New “Bad” Part?

WebPack

  1. Webpack — The Confusing Parts
  2. Webpack & Hot Module Replacement [HMR] (under-the-hood)
  3. Webpack’s HMR And React-Hot-Loader — The Missing Manual

Draft.js

  1. Why Draft.js And Why You Should Contribute
  2. How Draft.js Represents Rich Text Data

React And Redux :

  1. Step by Step Guide To Building React Redux Apps
  2. A Guide For Building A React Redux CRUD App (3-page app)
  3. Using Middlewares In React Redux Apps
  4. Adding A Robust Form Validation To React Redux Apps
  5. Securing React Redux Apps With JWT Tokens
  6. Handling Transactional Emails In React Redux Apps
  7. The Anatomy Of A React Redux App
  8. Why Redux Need Reducers To Be “Pure Functions”
  9. Two Quick Ways To Reduce React App’s Size In Production

Salesforce

  1. Developing React Redux Apps In Salesforce’s Visualforce

--

--

Trying to make Web development simple. Former Developer Advocate @Salesforce, VMware (node.js); Engineer @ Yahoo, Zimbra. Twitter: @rajaraodv

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store