Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of using withTheme with Flow #53

Open
mmavko opened this issue Jun 10, 2019 · 0 comments
Open

Example of using withTheme with Flow #53

mmavko opened this issue Jun 10, 2019 · 0 comments
Labels
question Further information is requested

Comments

@mmavko
Copy link

mmavko commented Jun 10, 2019

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 mmavko added the question Further information is requested label Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant