Inconsistent `Provider` placement in components

Abierto
#10,626 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
56/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Read the discussion linked from the issue, then compare Provider placement in packages/react-aria-components/src/Select.tsx, NumberField.tsx, SearchField.tsx, and TextField.tsx. Determine the consistent placement that preserves context for render-prop containers, apply it across the affected components, and verify the behavior with the relevant component tests.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Discussed in https://github.com/adobe/react-spectrum/discussions/10155

Originally posted by af-cf June 3, 2026
Hi. I noticed that certain components have an inconsistent placement of <Provider>. Sometimes it's the root element, sometimes it's not.

Examples:

I noticed when implementing RAC I would use render prop to render a generically styled form field container component, RAC components that do not have Provider as root would (for obvious reasons) not set the context props for elements like RAC label or error that are inside of that form field container component.

For now I am relying on testing as I implement to determine whether render prop works or not and then opt for nesting the field container component instead if render doesn't work. However I imagine ideally it should be consistent across all of the components that implement a provider.

More concrete examples in comment https://github.com/adobe/react-spectrum/discussions/10155#discussioncomment-17322355

Lenguaje dominante
TypeScript
Estrellas
16k
Forks
1.6k
Merge medio
3 d 9 h
PR fusionados (30 d)
45

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de adobe/react-spectrum

Todos los issues de adobe/react-spectrum

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.