This is the code
import React from "react"
let x = 0;
const App = () => {
x++;
console.log(x)
return(
<div>
<p>{x}</p>
</div>
)
}
export default App;
The console shows 1...but the page shows 2...
How is possible that the code inside the function executes twice(Apparently the x++ runs twice) and the console only outputs one time (1)