Issues with `createText` typing

Abierto
#153 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Start by tracing the createText typing and compare its generic and inferred props behavior with the custom component examples in the issue. Check whether createBox has the same pattern, then verify that custom components require the expected props and style prop while calculated props remain supported.

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

Descripción

enhancement

What:

  • Not forcing you to pass the custom component props as generic, this leads to add all the RN Text props to the restyled custom component.
const CustomText = ({ title }: { title: string }) => <Text>{title}</Text>;

const RestyledCustomText = createText<Theme>(CustomText);

<RestyledCustomText color="lightpink" accessibilityLabel="I am a label" />;
  • There is no type inference between the generic and the props of the passed component:
const CustomText = ({ title }: { title: string }) => <Text>{title}</Text>;
const RestyledCustomText = createText<Theme, {}>(CustomText);
  • We are not forcing the passed custom text to have a style prop (the style prop will contain all the calculated props as a style object)

I believe the same applied for createBox.

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.