Reputation: 485
Why is console.log logging twice inside contructor and render method ?
Upvotes: 0
Views: 101
Reputation: 2528
In simple CRA they do
<React.StrictMode>
<div>
<App />
</div>
</React.StrictMode>
React.StrictMode
Is for developers help. It will show helpful warning and all. For that it need to intentionally double-invoking the following functions:
You can remove React.StrictMode by <>
And you can learn more about strict mode from here
Upvotes: 3