Go to content

Wait, react is multi-threaded? - Nikhil Sharma

We already know, "if some task takes time, promisify it!". But some tasks can be computation heavy and can take time to complete, so making them async is of no use since those have to be anyway get picked. Solution? Simple, multithreading! Yeah I know that React and in turn JavaScript is single-threaded but what if I told you that our life was a lie ever since? Enter web workers! The web is single-threaded. This makes it increasingly hard to write smooth and responsive apps. Workers have a bad rep, but can be an important and useful tool in any web developer’s toolbelt for these kinds of problems. This talk would dive into the how we encounter some real-world scenarios with React like a search feature, and how web workers come to our rescue by helping us do intensive work in parallel, without blocking the main thread. We will also see how it relates to the brand new "Concurrent mode" feature, all of this with the fun of examples, Sounds interesting right? The talk reveals it all!

October 14, 2022