Ability to create controlled Input components.
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, react
- Área
- frontend
Línea de trabajo
Comienza localizando el componente Input y leyendo cómo están implementados actualmente su valor actual y el comportamiento de defaultValue. Comprueba los ejemplos existentes de Storybook y las pruebas de Jest del componente, si las hay, y verifica después que los comportamientos controlado y no controlado solicitados estén cubiertos y documentados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 4
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bcgov/react-shared-components
-
It's Been a While Since This Repository has Been UpdatedQuizá libre de nuevo @ShellyXueHan la tomó hace 1685 días y no hay ningún pull request abierto. Abierto
bcgov/react-shared-components#557 · 4 comentarios · 5 asignados ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
bcgov/react-shared-components#486 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 42/100
bcgov/react-shared-components#485 ·
-
approved
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
bcgov/react-shared-components#373 · 2 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
bcgov/react-shared-components#356 ·
Todos los issues de bcgov/react-shared-components
Issues similares
-
[Bug]: [A11y] Missing accessible name on icon-only standalone links (WCAG 2.1 SC 2.4.4, 4.1.2)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jaegertracing/jaeger-ui#4596 ·
Los mantenedores suelen responder en 1 día
-
Add: CNC Region Calima [CO]Abiertochannels:add check:passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 9 días
-
module: core
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
bigbluebutton/bigbluebutton#26028 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
twbs/bootstrap#43050 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
status:untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
midnightntwrk/servicedesk#248 ·
Los mantenedores suelen responder en 1 día