Why is my react component rendering twice on initial load?
问题 I have a functional component called (First) function First() { const [count,setCount]=useState(0) console.log("component first rendering") // this logging is happening twice return ( <div> first component </div> ) } when i initially run the application the console statement is logging twice why is it, It should have been logged only once, because i haven't explicitily updated the state. 回答1: I've tried this out in code sandbox here and sure enough, it did render twice. This is because, in