[bug]: `useTransition` with boolean item and function config doesn't animate since `9.5.2`

Open
#2,180 0 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
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start with the linked CodeSandbox reproduction, especially src/App.tsx, and inspect the @react-spring/web useTransition call that passes a boolean followed by a function config. Compare its behavior between version 9.5.2 and 9.7.1. Done means the documented syntax either animates as expected or produces an appropriate TypeScript error.

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.7.1

What's Wrong?

When using useTransition, if you pass in a boolean as the first argument and a function as the second argument, the transitions do not run as expected.

This syntax use to work in previous versions up until version 9.5.2, where it's suddenly stopped working.

To Reproduce

Code sandbox which demonstrates the issue https://codesandbox.io/s/little-voice-5hl8w6?file=/src/App.tsx

Expected Behaviour

If this syntax is not valid, I would expect to see some Typescript errors.

If it is valid syntax, I expect the transitions to run as expected.

Link to repo

https://codesandbox.io/s/little-voice-5hl8w6?file=/src/App.tsx

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.