DEV Community

Cover image for What is Strict Mode in React?

What is Strict Mode in React?

Code of Relevancy on March 24, 2023

Hello React developers, you've probably heard of strict mode. But what the hell is it, exactly? In short term, React.StrictMode is a useful compone...
Collapse
 
sergeyleschev profile image
Sergey Leschev •

Great article on Strict Mode in React! As a developer, I appreciate any tool or component that helps me catch potential problems before they cause issues for users. It's great to see how can highlight issues and improve the overall quality of an application. In our projects, we also use strict mode in our React applications to ensure best practices are followed and the performance is optimized. Thanks for sharing this informative piece!

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Glad you found it helpful.. Thank you for your great feedback. Happy coding..

Collapse
 
dmikester1 profile image
Mike Dodge •

Very helpful and informative article! I never understood what strict mode was for. I just wish there was a way to make it work with WebSockets. I've had to disable Strict Mode to get WebSockets to work. github.com/facebook/create-react-a...

Collapse
 
duxtech profile image
Cristian Fernando •

good article!

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thank you my friend

Collapse
 
fruntend profile image
fruntend •

Сongratulations 🥳! Your article hit the top posts for the week - dev.to/fruntend/top-10-posts-for-f...
Keep it up 👍

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thanks a ton man..

Collapse
 
yogini16 profile image
yogini16 •

Wow, great article.
Thank you for this post

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thank you..

Collapse
 
devland profile image
Thomas Sentre •

Thank you for sharing, It's helpful.

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Glad you found it helpful. Thank you sir..

Collapse
 
abhixsh profile image
Abishek Haththakage •

great article

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thank you bro

Collapse
 
bybydev profile image
byby.dev •

This is a great article! You did a great job explaining Strict Mode in React. I learned a lot from it. Thanks for sharing!

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thank you for sharing kind words

Collapse
 
bretbernhoft profile image
Bret Bernhoft •

You used fantastic visuals/images for this article. Great job! And you explained Strict Mode in React nicely. I appreciate the effort that you put into this.

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

I designed those visuals by myself. Thank you boss for your kind words and appreciation.. Happy weekend

Collapse
 
codebucks profile image
CodeBucks •

Great article and explanation.

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thank you boss 🙏

Collapse
 
lotfijb profile image
Lotfi Jebali •

This is helpful and well explained thank you

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thank you my friend 🙏

Collapse
 
roix profile image
roix •

Any reason this not enabled by default?

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Hmm, it may have a negative impact on the performance of your app if it's enabled as default. performs some additional checks to catch the potential bugs..

Collapse
 
sherrydays profile image
Sherry Day •

Thanks for this.

Can you provide examples of how React.StrictMode helps identify issues related to unsafe lifecycle methods or improper use of the ref API in a developer's code?

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thanks for reading it.
You have a good point, I will update the article accordingly..

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

I have updated the article as per your request..

Collapse
 
codeofaccuracy profile image
Code Of Accuracy •

Thank you for sharing this article! I found it to be really informative and well-written, Your writing style is engaging and easy to follow, and I learned a lot from reading your article.

Collapse
 
codeofrelevancy profile image
Code of Relevancy •

Thank you bro for appreciating it..

Collapse
 
bestskipper profile image
Ghanshyam Thakkar • • Edited

Grate article.. Thanks