Skip to content

Example of using withTheme with Flow #53

@mmavko

Description

@mmavko

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions