Animated component breaks formatted string
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 il CodeSandbox collegato in src/App.js e riproduci il caso animated.p usando react-spring v9.2.4, React 17 e Intl.NumberFormat con signDisplay: "always". Traccia l’interpolazione del figlio e il nuovo rendering dopo il completamento dell’animazione. Il lavoro è completato quando le stringhe positive formattate conservano il segno più iniziale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 Bug Report
I have an <animated.p>. It gets passed a formatted string from Intl.NumberFormat with signDisplay: "always". This means a + is prepended. This plus gets dropped by the component 🙈 .
I've logged the strings as they get passed, it never omits the plus. Yet, after the animation is finished, the component with its child string gets rerendered for whatever reason it seems, and the plus disappears.
I'm pretty stumped. As it stays on the minus side I was thinking maybe it gets parsed, recognized as number, re-stringified, and that's how it disappears. Has to be something like it, and yet, even prepending a letter to the passed string to break any presumed parsing doesn't change anything.
To Reproduce
- create an animated component with a spring that animates to a positive number.
- pass the positive number formatted with NumberFormat
signDisplay: always
Expected behavior
strings stay formatted the way they're passed.
Link to repro (highly encouraged)
https://codesandbox.io/s/happy-breeze-k5b37?file=/src/App.js
If you'd like to skip the repro, here's what the following logs:
<animated.p className="-mb-2">
{growthRateA.to((n) => {
console.log(
"gauge val",
growthRate,
n,
percentChangeFormatter.format(n)
);
return `${percentChangeFormatter.format(n)}`;
})}
Details
gauge val -0.011 -0.011 -1.1%
gauge val 0.031 -0.011 -1.1%
gauge val 0.031 -0.010121548193517607 -1.0%
gauge val 0.031 -0.00857916774249765 -0.9%
gauge val 0.031 -0.005950740117543118 -0.6%
gauge val 0.031 -0.0029392530728557277 -0.3%
gauge val 0.031 0.0030268882813645867 +0.3%
gauge val 0.031 0.0043572052262135326 +0.4%
gauge val 0.031 0.008124811754838784 +0.8%
gauge val 0.031 0.012428674047926122 +1.2%
gauge val 0.031 0.015282572633774496 +1.5%
gauge val 0.031 0.019405160906445458 +1.9%
gauge val 0.031 0.022080519063728186 +2.2%
gauge val 0.031 0.02389470716540138 +2.4%
gauge val 0.031 0.026299391624859 +2.6%
gauge val 0.031 0.028825197159883555 +2.9%
gauge val 0.031 0.030074829158552547 +3.0%
gauge val 0.031 0.031120467901732316 +3.1%
gauge val 0.031 0.032136375095277364 +3.2%
gauge val 0.031 0.03324458904176794 +3.3%
gauge val 0.031 0.03341674944892716 +3.3%
gauge val 0.031 0.03379429059057049 +3.4%
gauge val 0.031 0.034034462926820684 +3.4%
gauge val 0.031 0.03402336228008903 +3.4%
gauge val 0.031 0.033967395783605976 +3.4%
gauge val 0.031 0.0338198482844161 +3.4%
gauge val 0.031 0.033655547240881566 +3.4%
gauge val 0.031 0.03323786042677272 +3.3%
gauge val 0.031 0.033175304905596906 +3.3%
gauge val 0.031 0.032903915378158954 +3.3%
gauge val 0.031 0.03263141011617155 +3.3%
gauge val 0.031 0.03235126611329709 +3.2%
gauge val 0.031 0.03210147120371028 +3.2%
gauge val 0.031 0.03187080596101644 +3.2%
gauge val 0.031 0.03166233598676437 +3.2%
gauge val 0.031 0.031467693381792144 +3.1%
gauge val 0.031 0.03130912302727817 +3.1%
gauge val 0.031 0.031174775466065223 +3.1%
gauge val 0.031 0.031057804428564314 +3.1%
gauge val 0.031 0.030965058583005904 +3.1%
gauge val 0.031 0.030901156456320494 +3.1%
gauge val 0.031 0.03085035087798566 +3.1%
gauge val 0.031 0.030813362199849245 +3.1%
gauge val 0.031 0.030792923903493395 +3.1%
gauge val 0.031 0.030781616531037656 +3.1%
gauge val 0.031 0.03078008319142252 +3.1%
gauge val 0.031 0.030785416615148938 +3.1%
gauge val 0.031 0.03079703394264702 +3.1%
gauge val 0.031 0.03081304343731894 +3.1%
gauge val 0.031 0.030829713834723847 +3.1%
gauge val 0.031 0.030848873417013662 +3.1%
gauge val 0.031 0.030870956731571284 +3.1%
gauge val 0.031 0.030892771279615535 +3.1%
gauge val 0.031 0.030912490436875762 +3.1%
gauge val 0.031 0.03093465114884642 +3.1%
gauge val 0.031 0.0309566119187836 +3.1%
gauge val 0.031 0.031 +3.1%
gauge val 0.031 0.031 +3.1%
gauge val 0.031 0.031 +3.1%

Environment
react-springv9.2.4reactv17.0.x
Thanks for an amazing animation library! Managed to drop a full component. So easy to use 👍 .
- Lingua principale
- TypeScript
- Stelle
- 29.3k
- Fork
- 1.2k
- Merge medio
- 3g 15h
- PR unite (30g)
- 17
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pmndrs/react-spring
-
template: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
pmndrs/react-spring#2656 ·
I maintainer di solito rispondono entro 1 giorno
-
area: core kind: request
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
pmndrs/react-spring#2542 ·
I maintainer di solito rispondono entro 1 giorno
-
area: typescript kind: request release: major
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
pmndrs/react-spring#2541 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
release: major type: RFC
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
pmndrs/react-spring#2522 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[bug]: Tab crash with skipAnimation and loopForse già presa @mrityunjay-pandey l’ha presa 43 giorni fa. Apertaarea: core kind: bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
pmndrs/react-spring#2409 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pmndrs/react-spring
Issue simili
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
lingdojo/kana-dojo#34714 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
manaflow-ai/cmux#59692 ·
I maintainer di solito rispondono entro 1 giorno
-
Retire stale Python-parity labels in Rust ingress and auth testsForse già presa @github-actions l’ha presa oggi. Apertafactory factory:building factory:unowned ralph-status:in-progress via:opencode-free/hy4-flash-free
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
JoshCLWren/comic-pile#5874 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area: community lane: free-agent priority: P1 roadmap type: task
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
velella-sh/offing#1046 ·
I maintainer di solito rispondono entro 1 giorno