react-theme-provider icon indicating copy to clipboard operation
react-theme-provider copied to clipboard

Example of using `withTheme` with Flow

Open mmavko opened this issue 6 years ago • 0 comments

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

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

class MyCmp extends PureComponent<Props> { ... }

Then I export it like this:

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?

mmavko avatar Jun 10 '19 10:06 mmavko