React and MobX — Lessons Learned

React and MobX — Lessons Learned

A few years ago, I had the challenge to assemble and develop the front end of a product. When I started, I was told that I was supposed to use React, but besides that, I could build however I wanted.

Introduction

A few years ago, I had the challenge to assemble and develop the front end of a product. When I started, I was told that I was supposed to use React, but besides that, I could build however I wanted.

Redux?

Among many other choices I had to make, I had to decide if I would use Redux or not, as well as how I would deal with the data in the application. I was already familiar with Redux and some Flux implementations, as well as their ecosystems, but one thing that has bothered me a little bit was that there are more and more libraries and dependencies for each type of problem/situation you come across — and, as most of the knowledge available online is based on the most famous boilerplates, you end up being forced to plug several libs into the project without even knowing if you really need them.

MobX

Then I began looking for alternatives and found MobX. At first, I thought it was very different, so there is some kind of a learning curve, but it’ll pass quickly. It is interesting how MobX has good support from developers/companies, how it’s not driven by corporate interests at first, and how the community is relatively big (even though it has nothing on Redux, of course). After all, it is very easy to start using MobX. However, I fell into some traps that I would have liked to know better when I started, so I decided to write some tips.

Before explaining how MobX works, as I’m talking about React, it’s worth saying briefly that I also had to choose whether to use the Create React App or not. I needed server-side rendering, which CRA doesn’t support, and among Facebook’s own recommendations for SSR, there’s Next.js and Razzle. I really like Next and the whole Zeit ecosystem, but one way or another, you end up getting stuck in it. On the other hand, Razzle is very flexible by definition. It is just a basis for the project and pretty much everything in it is customizable. As I didn’t know then much about what was ahead in my challenge, I chose it (worth a look). I just needed to install and import mobx and mobx-react into the project in order to use React (via Razzle) with MobX.

javascript development programming mobx react

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Hire Dedicated React Native Developer

Have you ever thought of having your own app that runs smoothly over multiple platforms? React Native is an open-source cross-platform mobile application framework which is a great option to create mobile apps for both Android and iOS. **[Hire...

Hire Dedicated React Native Developer in India | React Native Development

Hire dedicated React Native developers for your next project. As the top react native development company we offer you the best service as per your business needs.

Hire React Js Developer from Expert React JS Development Company

Are you looking to [hire React JS developer](https://www.mobiwebtech.com/react-js-development-company/ "hire React JS developer") from a prestigious and reliable React JS development company? Visit at Mobiweb Technologies here we have a big team...

A Short Guide to React Native App Development

React Native is undoubtedly one of the most widely used cross-platform frameworks for creating native-like apps. This framework can be easily used for developing brand-new apps from scratch and even in existing iOS or Android projects.easily used for developing brand-new apps from scratch and even in existing iOS or Android projects.