[bug]: Imperative .start() doesn't account for delay

Open
#1,908 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
react, typescript
Domain
frontend

Research direction

Start by reproducing the example with @react-spring/web, a 5000 ms delay, and imperative animate.start(). Trace the imperative start behavior and add a regression test for the delay; done means the delay is honored when .start() is called.

Written by the indexing model from the issue text.

Description

area: core kind: bug
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.0.0

What's Wrong?

I have a spring which should be delayed when called through the imperative .start(). But it seems like the delay value gets ignored. Is this expected? Is this by design?

To Reproduce
const [springProps, animate] = useSpring(() => ({
   from: { opacity: 0 },
   to: { opacity: 1 },
   delay: 5000
})

// Bunch of code later

animate.start()
Expected Behaviour

When .start() is called, a delay happens before the animation triggers.

Link to repo
Dominant language
TypeScript
Stars
29.3k
Forks
1.2k
Avg merge
3d 15h
Merged PRs (30d)
17

Getting set up

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.

More from pmndrs/react-spring

All issues in pmndrs/react-spring

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.