Member-only story
What is StrictMode in React
Everything you need to know about React.StrictMode
Often when I look back at a piece of code I wrote long ago, I think that I could have written it 100 times better. I am sure I am not the only one in this boat. As we gain more experience, we constantly evolve our coding practices and design patterns. This is the case with React too.
React also has gone through a lot of transitions, and as it has progressed, certain practices that were believed to be good in the past are no longer fit for the future roadmap. One significant change happened with the release of v16 where it went through a re-write onto React Fiber’s architecture. The major focus was on scheduling (i.e. deciding when a piece of work should be performed while keeping in mind the priorities of different tasks such as animations, UI updates, and so on).
At about the same time, a new Context API was added in React.
Also, with the goal of providing Concurrent Mode in future versions where the rendering phase is split into multiple parts, a lot of change has come about. The start of it saw the introduction of React Hooks, deprecation of certain lifecycle methods, and more.
In this article, we will look at all the deprecated patterns that StrictMode
in React helps us to identify.