Why do two identical outputs occur in the console?

Two identical outputs occur in my project with React

Code enter image description here

Output enter image description here

How do I get it to be a single output

>Solution :

In development mode, React will call your components & effects twice to determine potential bugs. Nothing to worry about.
This behaviour comes from <React.StrictMode/>.
You can check out the documentation here.
If you want to render once, find the root component of your app (generally App.js) and remove the React.StrictMode wrapper.

Leave a Reply