pmndrs / pmndrs/react-spring

[bug]: callbacks are not called with imperative useTransition style

Open
#2,048 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: core kind: bug
Dominant language
TypeScript
Stars
29.1k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Which react-spring target are you using?
  • @react-spring/web
  • @react-spring/three
  • @react-spring/native
  • @react-spring/konva
  • @react-spring/zdog
What version of react-spring are you using?

9.6.1

What's Wrong?

Callbacks onStart, onChange, onRest are not called using imperative style (they work using external SpringRef tho).

To Reproduce

See codesandbox

Expected Behaviour

Callbacks to be called

Link to repo

https://codesandbox.io/s/cool-euler-svriws

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and inspect the imperative useTransition path for @react-spring/web. Compare its callback behavior with the external SpringRef case described in the issue; done means onStart, onChange, and onRest are called in imperative useTransition usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.