Type issues with restyle component props

Abierto
#161 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Reproduce the TypeScript compiler failure in createBox.ts and inspect the prop types used by the Box and Pressable patterns. Run the repository's type-checker to confirm the shown constraint error is resolved; done means a fresh clone no longer reports this failure.

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

Descripción

needs-reproduction

I noticed that the TypeScript compiler produces an error in the createBox.ts file. At first I thought it was an issue in my code, but a fresh clone and open of restyle has the same issue.

I'm trying to make my own "Box" component for Pressable, so I was following the pattern of Box. I'm concerned because even if it works, I don't think it's a good idea to ship code that doesn't even pass the type-checker—it defeats the whole purpose.
Screen Shot 2022-05-25 at 3 51 32 PM

Type 'BoxProps<Theme, EnableShorthand>' does not satisfy the constraint 'Record<string, unknown>'.
  Type '(BackgroundColorProps<Theme> & OpacityProps<Theme> & VisibleProps<Theme> & LayoutProps<Theme> & ... 9 more ... & BackgroundColorShorthandProps<...>) | BaseBoxProps<...>' is not assignable to type 'Record<string, unknown>'.
    Type 'BackgroundColorProps<Theme> & OpacityProps<Theme> & VisibleProps<Theme> & LayoutProps<Theme> & ... 9 more ... & BackgroundColorShorthandProps<...>' is not assignable to type 'Record<string, unknown>'.
      Index signature for type 'string' is missing in type 'BackgroundColorProps<Theme> & OpacityProps<Theme> & VisibleProps<Theme> & LayoutProps<Theme> & ... 9 more ... & BackgroundColorShorthandProps<...>'.ts(2344)
Lenguaje dominante
TypeScript
Estrellas
3.4k
Forks
154
Métricas de merge de PR
Sin PR fusionados en 30 d

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 Shopify/restyle

Todos los issues de Shopify/restyle

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.