Skip to content

Support DomElastica refs on React 18#28

Open
Aayush10016 wants to merge 1 commit into
darkroomengineering:mainfrom
Aayush10016:fix/issue-15-dom-elastica-forward-ref
Open

Support DomElastica refs on React 18#28
Aayush10016 wants to merge 1 commit into
darkroomengineering:mainfrom
Aayush10016:fix/issue-15-dom-elastica-forward-ref

Conversation

@Aayush10016

Copy link
Copy Markdown

Fixes #15.

What changed

  • Wrapped DomElastica with forwardRef.
  • Kept the existing DomElasticaRef imperative API for play() and pause().
  • Removed ref from DomElasticaProps so React handles it as a real ref instead of a normal prop.

Why

The package allows React >=18.2, but plain function component ref props only work with React 19 behavior. In React 18, the ref is not delivered to DomElastica as a normal prop, so the imperative play() and pause() handle cannot be used reliably.

Using forwardRef preserves React 18 support without requiring a peer dependency bump.

Validation

  • node_modules\.bin\tsc.cmd -p packages\react\tsconfig.json --noEmit
  • npm --prefix packages\react run build

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

@Aayush10016 is attempting to deploy a commit to the Darkroom Team on Vercel.

A member of the Team first needs to authorize it.

@Aayush10016
Aayush10016 marked this pull request as ready for review July 24, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant