hello, dai-shi!
While studying your book, “Micro State Management with React Hooks,” I encountered an issue. In the example below, when count changes, only the Counter component should re-render. However, it seems that the re-render optimization is not working as expected.
Even when the count changes, the TextBox component is re-rendering, and I can’t figure out why.
I confirmed that re-rendering is occurring by using the “Highlight updates when components render.” feature in Chrome React DevTools.
hello, dai-shi! While studying your book, “Micro State Management with React Hooks,” I encountered an issue. In the example below, when count changes, only the Counter component should re-render. However, it seems that the re-render optimization is not working as expected.
Issue Code
Even when the count changes, the TextBox component is re-rendering, and I can’t figure out why. I confirmed that re-rendering is occurring by using the “Highlight updates when components render.” feature in Chrome React DevTools.