RajiDurai / Counter_React

counter problem
0 stars 0 forks source link

The parent and child are rendered twice #2

Open RajiDurai opened 3 months ago

RajiDurai commented 3 months ago

Issue description: The parent and child are rendered twice every time there is a change in state or app is initiated or refreshed. Root cause: It looks like in index.js the app is running in strict mode. Fix: Remove strict mode. Source: https://stackoverflow.com/questions/48846289/why-is-my-react-component-is-rendering-twice

RajiDurai commented 3 months ago

More resources: https://legacy.reactjs.org/docs/strict-mode.html#detecting-unexpected-side-effects