callstack / callstack/react-theme-provider

Example of using `withTheme` with Flow

Abierto
#53 0 comentarios 0 reacciones 0 asignados Ver en GitHub
question
Lenguaje dominante
JavaScript
Estrellas
467
Forks
53
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I create a component with `Props` type that includes a theme:

```js
type Props = {
theme: MyTheme,
otherProps: any,
};

class MyCmp extends PureComponent { ... }
```

Then I export it like this:

```js
export withTheme(MyCmp);
```

Then when I import it and use in JSX I'm getting a Flow error that `theme` prop is required.

What is the idiomatic example of defining `withTheme` component with Flow?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.