[bug]: When using useTranstion, the element corresponding to the initial value is not displayed.

Aperta
#1,928 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia con l’esempio di transizioni a più fasi di useTransition disponibile all’indirizzo https://react-spring.dev/hooks/use-transition#multi-stage-transitions e riproduci il comportamento nel CodeSandbox collegato. Confronta il comportamento di @react-spring/web tra le versioni 9.4.4 e 9.4.5 per i valori enter basati su array o funzioni; il lavoro è completato quando gli elementi iniziali vengono renderizzati con il valore previsto senza la sequenza from → enter → from.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

What's Wrong?

If an array or a function that returns an array is specified for the enter property of useTransition, elements that are drawn based on data passed as initial values in the first argument will complete drawing at the value specified in from.
(To be precise, they appear to animate from -> enter -> from.)

This problem is not reproduced when a single value, not an array, is specified for the enter property.
The problem does not occur in version 9.4.4, so the bug seems to be in 9.4.5.

To Reproduce

https://react-spring.dev/hooks/use-transition#multi-stage-transitions

Expected Behaviour

The element is displayed correctly for the initial value.

Link to repo

https://codesandbox.io/s/delicate-platform-vsik5n

Lingua principale
TypeScript
Stelle
29.3k
Fork
1.2k
Merge medio
3g 15h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pmndrs/react-spring

Tutte le issue di pmndrs/react-spring

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.