Questions tagged [react]
Post a PromptPrompts that generate React components and apps.
8 prompts
26votes
3answers
6.5kviews
One-shot prompt for a dashboard data table that isn't the same shadcn gray boxes
Every dashboard prompt I tried gave me the identical gray-card-with-a-number-and-a-tiny-line-chart layout, and a table that was just a styled div with none of the behavior that makes a table useful. I
23votes
2answers
2.7kviews
Real-time metrics dashboard with sparkline gauges over a websocket feed
I was building a live ops board that streams a few dozen metrics over a websocket, each shown as a number plus a rolling sparkline. The naive build re-rendered the entire React tree on every message a
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
24votes
1answers
4.3kviews
Admin dashboard prompt that doesn't produce the same three gray shadcn cards
Every dashboard I one-shotted came out as the identical layout: three stat cards on top, a big line chart, a table. Technically fine, visually indistinguishable from every other AI dashboard on the in
24votes
2answers
2.8kviews
Prompting a multi-step onboarding flow that people actually finish (not a 9-field wall)
Growth eng here. Our old signup was a single screen with nine fields and a 38% completion rate. I wanted AI to help me design a progressive flow, but the naive prompt just gave me the same nine fields
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
25votes
1answers
2.8kviews
Prompt for end-to-end typed forms with zod + react-hook-form and no type drift
The recurring pain: the zod schema, the TypeScript type, and the form field names would drift apart, so you'd validate a field the form didn't have, or submit a shape the API rejected. Three sources o