Example of using `withTheme` with Flow
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react
- Domain
- documentation
Research direction
Start from the withTheme and PureComponent examples in the issue and investigate how the wrapped component's Flow props are expected to be declared. Document an idiomatic Flow example that prevents theme from being required at JSX call sites; no file or test is identified in the issue.
Written by the indexing model from the issue text.
Description
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?
- Dominant language
- JavaScript
- Stars
- 466
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/react-theme-provider
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
question
Difficulty 5/5 Over a week Newbie friendliness 10/100
callstack/react-theme-provider#156 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
callstack/react-theme-provider#144 · 3 comments · 4 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
callstack/react-theme-provider#139 · 1 comment · 12 reactions ·
All issues in callstack/react-theme-provider
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
light
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aemdemos/patients-stryker#253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·