Skip to content

Document why imperative DOM modules live outside React #32

@andimrob

Description

@andimrob

Problem

~40% of the JS by line count (xray.ts, confetti.ts, coinCollect.ts) creates/destroys DOM nodes imperatively, outside React's component tree. This isn't a bug — they're ephemeral overlays — but it's invisible to React DevTools and may confuse future contributors.

Recommendation

  • Add a brief comment at the top of each file explaining why it's outside React (fire-and-forget overlay, no React state needed, avoids re-render coupling)
  • If these ever need to compose with React state (e.g. "show confetti when a project card is clicked"), convert them to React portals at that point
  • No immediate code changes needed

Priority

Low — documentation/clarity improvement only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions