pmndrs / pmndrs/react-spring

[bug]: Can't represent nullable values in spring

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

Nobody has claimed this yet.

template: request
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.7.3

What's Wrong?

When I set a spring to null, especially with immediate: true, I expect it to happen (undefined would also work).

To Reproduce

https://codesandbox.io/p/sandbox/lingering-fire-zr6ndd?workspaceId=80a9d860-12d9-4443-890c-a440aefb7d3c

Expected Behaviour

override spring should be set to null when override state is, but it is not.

Link to repo

https://codesandbox.io/p/sandbox/lingering-fire-zr6ndd?workspaceId=80a9d860-12d9-4443-890c-a440aefb7d3c

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 @react-spring/web target on version 9.7.3 and reproduce the behavior in the linked CodeSandbox. Trace how an override handles null or undefined, especially with immediate updates; done means the spring value reflects the override state when it is set to null or undefined.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.