callstack / callstack/react-theme-provider

Example of using `withTheme` with Flow

Offen
#53 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
JavaScript
Sterne
467
Forks
53
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.