0

Everytime I run my code on reactjs, console.log() runs twice in constructor,render, or in the components. Why does it do that?

class App extends Component {
  constructor(props){
    super(props);
    console.log("[App.js] constructor")
  }

1 Answers1

0

You are probably using React in Strict Mode. Hence it occurs twice. This wont happen when you use production build of your react app.
This might help you further

Rishi Desai
  • 111
  • 1
  • 4