RajiDurai / Counter_React

counter problem
0 stars 0 forks source link

Issue #1 is tricky - To identify rendering issue on both parent and child. #5

Open RajiDurai opened 1 month ago

RajiDurai commented 1 month ago

I have thought that the rendering issue in both parent and child is that it's being rendered twice due to strict mode. But now, I'm not convinced that's the issue because the strict mode is used for development purposes to identify issues and so it renders twice. It can taken as issue technically but there is more to identify on the original problem. I would say child component is not at all needed as it's just used for only decoration purpose just displaying a immutable text in a span tag. If child is needed, then I would reverse engineer and make the UI to display childcomponent more dynamic for example, "No of clicks" on it where the value is passed through 'props' from parent.