Use this skill when optimizing React frontend performance in apps that read data with TanStack React Query useQuery, do not perform mutations, and render third-party maps like Kakao Map after mount with useEffect or refs. It is especially relevant when some shared map or filter state is already kept in a store, but it does not recommend moving component-local UI state out of useState unless cross-component sharing is required. Apply it for render-cost analysis, query-key stability, effect minimization, marker synchronization, and preventing unnecessary rerenders around map/list UIs.
Use this skill to analyze and improve runtime performance in React applications that:
useQueryThis skill assumes useState is the default for component-local UI state. Treat stores as a coordination tool for genuinely shared state, not as a default optimization technique.
Prioritize changes that reduce avoidable rerenders and repeated imperative work. Do not add complexity unless a measurable hot path exists.
Identify the render boundary. Inspect which components rerender when query params, map position, or loading state change.
Separate declarative state from imperative map work. Keep React responsible for query params, loading UI, and list rendering. Keep Kakao Map instance creation, marker updates, and drag listeners isolated behind refs and effects.
Stabilize query inputs. Ensure query keys are built from primitive values, and avoid recreating objects that only exist to call .
queryFnReduce effect churn. Re-run effects only when the external system actually needs to change. A rerender is cheaper than tearing down and rebuilding third-party map artifacts.
Verify with a narrow measurement pass. Use React DevTools Profiler, temporary render counters, or targeted logs before and after the change. Avoid speculative memoization.
useState for component-local UI state.select to trim server payload to the smallest shape the UI needs.staleTime and gcTime tuning over manual refetch patterns.staleTime to reduce repeat fetches.queryKey primitive and explicit.queryFn focused on network I/O.select for shape reduction.Example shape:
const query = useQuery({
queryKey: ['places', mapX, mapY, radius, numOfRows],
queryFn: () => getPlaces({ mapX, mapY, radius, numOfRows }),
select: data => data.response.body.items.item,
enabled: Boolean(position),
staleTime: 30_000
});
useRef for map instanceAvoid patterns where marker arrays are kept in React state unless the UI renders from that state.
useEffect depends on values that do not semantically require a third-party redraw.useRef Instead Of useStateUse useRef when the value:
Typical examples in this stack:
Add useMemo or React.memo only if at least one of these is true:
Do not memoize primitive query params or trivial object creation unless it unblocks a proven rerender issue.
For projects shaped like Home -> HomeWithPosition -> KakaoMap + PlaceList:
usePlacesQuery responsible for network params and payload selection only.KakaoMap focused on container mounting and shared map coordination.pickPoint, confirm that only components that need pickPoint subscribe to it.When using this skill, produce:
If no meaningful bottleneck is demonstrated, say so and avoid decorative optimization.