いつも再レンダリングを確認するときは Chrome の DevTool から Profiler 立ち上げて、'Highlight updates when components render.' のチェックを入れていたのですが、それやらなくても良いじゃんということに気づいたのでメモ。 import * as React from "react" import { StateContext } from "./app" export const Count = () => { const context = React.useContext(StateContext) const getColor = () => Math.floor(Math.random() * 255) const style = { color: `rgb(${getColor()},${getColor()},${
![再レンダリングを検知するコード](https://cdn-ak-scissors.b.st-hatena.com/image/square/63d7491c6e65541137d4f975525f7cfc6e75ad2a/height=288;version=1;width=512/https%3A%2F%2Fblog.ojisan.io%2Fstatic%2Fa6bdd6436142c9d3b69c096fe4531c33%2Fe63fe%2Fvisual.png)