callstack / callstack/react-theme-provider

Example of using `withTheme` with Flow

Open
#53 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
467
Forks
53
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.