Image for post
Image for post

Are you using React to build user interfaces? Well, I am too. And now, you’ll learn why you should write your React applications using ReasonML.

React is a pretty cool way to write user interfaces. But, could we make it even cooler? Better?

To make it better, we need to identify its problems first. So, what is the main problem of React as a JavaScript library?

React wasn’t initially developed for JavaScript

If you take a closer look at React, you’ll see that some of its main principles are foreign to JavaScript. Let’s talk about immutability, functional programming principles, and type system in particular.

Immutability is one of the core principles of React. You don’t want to mutate your props or your state because if you do, you might experience unpredictable consequences. In JavaScript, we don’t have immutability out of the box. We are keeping our data structures immutable by a convention, or we use libraries such as immutableJS to achieve it. …


David Kopal

Lawyer turned developer. #JavaScript, #ReactJS, #ReasonML, #FunctionalProgramming

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