sinout2017-04-05 02:08:24
sinout, 2017-04-05 02:08:24

Does it make sense to use Immutable along with React?

I decided to read React Best Practices and everywhere they write that use Immutable. This will give you a boost in rendering and save you headaches.
The fact that it will save you from a headache with data mutation is understandable, but is there really an increase in rendering from this?
Soon I will start a big project and I want to understand if we need it at all.
On past projects, I tried to implement this lib, but they said that it was superfluous, because. everything is simply done with babel's object spread plugin.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Maxim Timofeev, 2018-03-09

One page sends an ajax request, the second responds, gives a link, the first receives a link to audio, inserts it into the audio tag and starts play ()

Puma Thailand, 2018-03-09

Dig into html audio or flash

Mikhail Goryachkin, 2017-04-05

So don’t cling to Immutable.js, the point is that the data must be immutable, and with what help you achieve this it’s up to you, you can generally just use Object.assign (actually the object spread plugin does this) and you will be right too. If the project is large, then I would recommend that you stick to the Immutable data paradigm, the headache will definitely become less. As for rendering, it won't give you any performance boost, but due to the fact that you have full control over the changes to your objects, you can use shouldComponentUpdate wisely and that's when it can give you a good boost.

Islam Ibakaev, 2017-04-05

the advantage of the immutable library over Object.assign ( or spread operator ) is named - structural data sharing .
Again, it all comes down to increasing the boost. If you have such a complex project that the effectiveness of native options is not enough - feel free to connect immutable. Otherwise, there is no need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question