react-render-performance
React Render Performance
Patterns for minimizing unnecessary React re-renders when consuming external
state. Prefer selector-based subscriptions over useState(wholeObject) —
subscribe only to the slice each component needs.
Core idea
Storing a full state object in React state (e.g. useState(snapshot) and
subscribing to every change) forces re-renders on any update. A component
that only needs phase will still re-render when quiz.selectedWrong changes
if both live in the same object.
Avoid: subscribe → setState(fullObject) → read a field in render.
Prefer: subscribe to a selector or slice so the component re-renders
only when that value changes. Every library below supports this; use it.
More from jonmumm/skills
dont-use-use-effect
>
59react-composable-components
>
41grill-me
>
32mutation-testing
Run and interpret Stryker mutation testing; kill survivors to reach ≥95% score. Use when running mutation tests, setting up Stryker, interpreting survivors, or verifying test quality after TDD.
32offensive-typesafety
>
31expo-testing
Build, install, and test Expo/React Native apps on simulators and physical devices. Use when asked to "run on simulator", "install on device", "test on phone", "run detox", "preview build", or "build and test".
30