Skip to content

Instantly share code, notes, and snippets.

@Guria
Created February 2, 2026 23:32
Show Gist options
  • Select an option

  • Save Guria/5372609d1b004dcf10888231959507dc to your computer and use it in GitHub Desktop.

Select an option

Save Guria/5372609d1b004dcf10888231959507dc to your computer and use it in GitHub Desktop.
Problem statement (pattern‑based)
A shared component uses prop‑based conditionals to drastically alter structure, layout, and behavior. This makes the component hard to reason about, harder to maintain, and leads to inconsistent UX across flows. The right fix is to extract the divergent branches into dedicated components and keep the shared logic minimal and reusable.
Copy‑paste prompt
“Find components where prop‑based conditionals dramatically change structure or behavior. Extract those branches into separate components and keep only genuinely shared logic in a base. Ensure each new component has a clear, consistent layout and UX, and remove leftover experimental or demo code.”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment