React Components Rendering Twice in Development

Lawson Hung
1 min readSep 19, 2020

This drove me nuts! I could not for the life of me figure out why my components were rendering twice. Marios however summed it up pretty well.

He talks about why it renders twice, and the main reason is that React.StrictMode is trying to help you debug.

Rest assured, this only happens in development and doesn’t happen in production. Still, this bug drove me nuts for a while because I could not for the life of me figure out why everything was rendering twice!!! A real hair-puller for sure.

I highly recommend giving his blog a quick read because it definitely helped me understand why my components were rendering twice in development. rest assured though, this is not a bug and is intended for debugging purposes with React.StrictMode.

Cheers! Now you can sleep well.

Stay safe y’all!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Lawson Hung
Lawson Hung

No responses yet

Write a response