SpringValue.map
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
La issue nomina SpringValue e animated, ma non identifica file, test o uno specifico punto di ingresso. Inizia individuando queste API e verificando come vengono attualmente gestiti i valori dipendenti; il lavoro sarebbe completo con un design concordato e test che coprano un valore mappato, ad esempio la conversione di 0 in un valore di visualizzazione nascosto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Proposal
react-spring's desire to completely avoid rendering has been causing tons and tons of problems for me ever since I tried adopting it. The seemingly opaque SpringValue datatype can only be used in very specific places due to the way animated works. I can't do things like change display to none only when a spring value is 0 because my component does not get re-rendered. It's so annoying and restrictive and I have to spend hours with each component figuring out how to coax the behavior I want out of the spring.
Perhaps one way to help with this would be to introduce a map method on SpringValue which would return another SpringValue that depends on the first one, allowing me to insert it into the right slots to get animated to recognize it, but process the values that reach the DOM. This would allow me to do things like hide an element when it is not visible (visibility value is 0).
<Spring to={...}>
{({value}) =>
<animated.div style={{display: value.map(v => v === 0 ? 'none' : undefined)}}>...</animated.div>
}
</Spring>
This will solve some of the issues with the current system without react-spring having to move to another.
Rationale
The perfect solution that I have come up with is a component that re-renders every frame by using window.requestAnimationFrame and detecting when the spring values change. Of course, this is the exact OPPOSITE of what this library is designed to do, but - it solves every single problem I had with spring, and allows me to use the values however I like. I call it the SpringSolidifier because it turns the SpringValues into actual values that can be used. It uses a render prop to return the "solidified" values object. Additionally, it allows me to completely unmount the element when it is fully invisible. This is currently not possible with react-spring to my knowledge. Due to this, I'm no longer reliant on the quirks of animated - springs become usable anywhere in my application, for any purpose, even CSS properties or conditional rendering or what-have-you.
However, since that component is the complete opposite of what this library currently does, I think a map function would fit the project better. It would allow react-spring to keep the updates out of React, but also allow the consumers of the library to control those updates. Right now react-spring only has the former.
- 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