Why
BtcIcon, TaoIcon, and AssetIcon are declared inside OrderbookDepth (src/components/dashboard/OrderbookDepth.tsx:29-84). Every parent render creates new component types, so React unmounts and remounts the SVG subtrees.
Not a user-visible bug today — the icons are stateless SVGs, so the remount is invisible. But it violates React's "don't define components inside components" guidance and becomes a real bug if the icons ever gain state, refs, animations, or lazy children.
Fix
Hoist to module scope; each icon calls useTheme() internally. No prop threading, no React.memo.
Acceptance
Why
BtcIcon,TaoIcon, andAssetIconare declared insideOrderbookDepth(src/components/dashboard/OrderbookDepth.tsx:29-84). Every parent render creates new component types, so React unmounts and remounts the SVG subtrees.Not a user-visible bug today — the icons are stateless SVGs, so the remount is invisible. But it violates React's "don't define components inside components" guidance and becomes a real bug if the icons ever gain state, refs, animations, or lazy children.
Fix
Hoist to module scope; each icon calls
useTheme()internally. No prop threading, noReact.memo.Acceptance
useTheme()inside each icon.tsc --noEmit+ lint pass.