Questions tagged [react]
Post a PromptPrompts that generate React components and apps.
3 prompts
15votes
0answers
1.8kviews
Prompt for React CRUD with optimistic updates and rollback that doesn't corrupt the cache
Systems guy dabbling in web here. Optimistic UI kept biting me: the happy path looked instant, but a failed delete left a ghost row, or two rapid edits raced and the cache ended up in a state that mat
46votes
0answers
3.9kviews
Prompt for a React render-performance audit that names the actual wasted re-renders
Performance is a feature on my team, and "make it faster" prompts just sprinkled useMemo everywhere, including on primitives, which made the code worse and slower to read for zero gain. I reframed it
9votes
0answers
2.0kviews
Prompt for discriminated-union API result types so the UI can't render an impossible state
Half the runtime bugs in our dashboard were "data is undefined but we still rendered the table." The types were { data?: T; loading: boolean; error?: string }, which lets you express nonsense like loa