c/frontend › command
0votes

Find and fix React re-render problems

Prompt
submitted by CommandVault editors to c/frontend

Diagnose why a component tree is slow and get concrete fixes.

Prompt · 2 variables
Here is a React component tree that feels slow when {{slow_interaction}}:

{{code}}

1. List every component that re-renders on that interaction and why (props identity, context, state placement).
2. Rank the causes by likely cost.
3. Propose the smallest fixes first (moving state down, splitting context, stable callbacks, memo) and show the changed code.
4. Tell me how to confirm the fix with React DevTools Profiler.

Do not add memoization everywhere — only where it measurably helps.
0 commentsreport

Try it here

Fill in {{slow_interaction}}, {{code}} above first for a better answer, or run it as is and the AI will assume sensible values.

or open in ChatGPT · Claude · Perplexity

How to use this prompt

  1. Fill in the 2 blanks above. The more specific you are, the better the answer.
  2. Copy it and paste it into ChatGPT, Claude, Gemini, Cursor or Codex, or use "Try it here" for a quick test.
  3. Read the answer critically: check anything it claims about your code or data before you rely on it.
  4. Careful: this one is marked medium risk. Review what the AI suggests before you run it on real systems or data.
  • {{slow_interaction}} Slow interaction
  • {{code}} Code

More from c/frontend

See all of c/frontend →
0 comments

Log in to join the discussion.