I've a simple child component that have string props, and why is it rendered twice at first laod?
export default function App() {
return (
<div className="App">
<h1>Hello CodeSandbox</h1>
<h2>Start editing to see some magic happen!</h2>
<MyChild a={1} b={2} />
</div>
);
}
const MyChild = ({ a, b }) => {
console.log("hi"); //called twice?
return <h1>hi</h1>;
};
demo https://codesandbox.io/s/wizardly-lamport-pesw42?file=/src/App.js