Skip to content

[C18] react: pause/play ref only works on React 19, but peers allow >=18.2 #15

Description

@GFier

From the 2026-07-06 codebase audit (docs/audits/codebase-audit-2026-07-06.md, in-repo). Finding IDs are stable — cite them in fixes.

Severity: High · Status: CONFIRMED

Problem

DomElastica takes ref as a plain prop (React 19 style) — no forwardRef anywhere (verified in src and the shipped bundle) — while peerDependencies allow react: ">=18.2.0" (dom-elastica.tsx:38, 231-234; packages/react/package.json).

Failure scenario

On React 18.2: <DomElastica ref={elasticaRef}> → React strips the prop, warns "Function components cannot be given refs", ref.current stays null → the only pause/play API silently doesn't exist. The README's "Control playback" section (readme.md:153-156) fails exactly this way on 18. (@types/react is ^19, so TS users on 18 also typecheck against the wrong API.)

Direction

Either wrap in forwardRef (works on both), or bump the peer to >=19 and document it. Audit open question 9: which React support range is real? Related: CanvasElastica has no ref/pause/play at all (C52, tracked in the epic).

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditFinding from a codebase auditbugSomething isn't workinghighHigh severityreactpackages/react

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions