Ability to create controlled Input components.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, react
- Ambito
- frontend
Direzione di ricerca
Inizia individuando il componente Input e leggendo come sono attualmente implementati il suo valore corrente e il comportamento di defaultValue. Controlla gli esempi Storybook e i test Jest esistenti del componente, se presenti, quindi verifica che i comportamenti controllato e non controllato richiesti siano coperti e documentati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
The current version of the Input component doesn't allow you to pass in values to the value attribute, only to the defaultValue attribute. This prevents developers from creating Input components that are controlled by passing in state to the value attribute.
Describe the solution you'd like
I would like the option to pass in a prop that gets passed into the value attribute on the input tag. One way I was thinking this could be done is by adding a prop called isControlled that determines whether the value passed into the value prop is passed down to the value or the defaultValue attribute.
If isControlled=true, pass the component's value prop to the value attribute on the input tag.
If isControlled=false, pass the component's value prop to the defaultValue attribute on the input tag. (This is how it currently works).
Describe alternatives you've considered
Another alternative would be to add another prop that is passed directly to value. However, this would allow developers to pass values to both value and defaultValue at the same time, which is considered a bad practice in React, and will generate warnings in the console.
- Lingua principale
- JavaScript
- Stelle
- 4
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 bcgov/react-shared-components
-
It's Been a While Since This Repository has Been UpdatedForse di nuovo libera @ShellyXueHan l’ha presa 1678 giorni fa e non c’è nessuna pull request aperta. Aperta
bcgov/react-shared-components#557 · 4 commenti · 5 assegnatari ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
bcgov/react-shared-components#486 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
bcgov/react-shared-components#485 ·
-
approved
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
bcgov/react-shared-components#373 · 2 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
bcgov/react-shared-components#356 ·
Tutte le issue di bcgov/react-shared-components
Issue simili
-
[quality] useFocusTrap's Shift+Tab wrap and non-Tab/non-Escape key arms are never driven end to endForse già presa @hivecommons-hive l’ha presa oggi. Apertaagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[aw] Upgrade availableApertaagentic-workflows
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
githubnext/gh-aw-workshop#4220 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
JuliusBrussee/caveman#1189 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:low ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenHands/extensions#738 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
invoiceninja/invoiceninja#13320 ·
I maintainer di solito rispondono entro 1 giorno