pmndrs / pmndrs/react-spring

[bug]: Typescript error with `position: "absolute"`

Open
#2,007 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: typescript 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.5.5

What's Wrong?

Setting position: "absolute" in the from property of the useTransition hook shows a typescript error when setting style on the animated div.

To Reproduce

Set position: "absolute" in the from property of the useTransition hook.

Expected Behaviour

No errors

Link to repo

https://codesandbox.io/s/youthful-gianmarco-y5q1v2?file=/src/App.tsx

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 by running the linked CodeSandbox and reproducing the TypeScript error with @react-spring/web, useTransition, and an animated div. Trace the types involved in the from property and style assignment; done means position: "absolute" produces no TypeScript error in the reproduced example.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.