# ReactJS - Why console.log executed two times?

**URL:** <https://forum.freecodecamp.org/t/reactjs-why-console-log-executed-two-times/378662>\
**Category:** General\
**Created:** [April 25, 2020, 9:18am UTC](https://forum.freecodecamp.org/t/reactjs-why-console-log-executed-two-times/378662 "2020-04-25T09:18:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sky020](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sky020/32/128093_2.png) [@Sky020](https://forum.freecodecamp.org/u/Sky020)\
**Post date:** [April 25, 2020, 9:52am UTC](https://forum.freecodecamp.org/t/reactjs-why-console-log-executed-two-times/378662/2 "2020-04-25T09:52:15Z")

</div>

Hello there.

For future posts, it would be much more useful if you posted some code, or a link to your project on CodePen, jsFiddle, or similar.

This was also discussed somewhat here: [Simple React Component Renders twice when using the useState hook](http://forum.freecodecamp.org/t/simple-react-component-renders-twice-when-using-the-usestate-hook/378110)

I suspect it is an issue with the way most online editors render. That being said, if you are hosting locally, and rendering using something like _create-react-app_, then I am not sure why your component would be rendered twice.

---

_[View the full topic](https://forum.freecodecamp.org/t/reactjs-why-console-log-executed-two-times/378662)._
