Skip to content

Commit

Permalink
Fix Flow for withTheme and dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrannp committed May 16, 2017
1 parent 5343b13 commit 4760ebb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@
.*/Libraries/react-native/ReactNative.js

; Ignore duplicate modules under example/
.*/example/node_modules/fbjs
.*/example/node_modules/fbemitter
.*/example/node_modules/react
.*/example/node_modules/react-native
.*/example/node_modules/expo
.*/example/node_modules/fbjs/.*
.*/example/node_modules/fbemitter/.*
.*/example/node_modules/react/.*
.*/example/node_modules/react-native/.*
.*/example/node_modules/expo/.*
.*/example/\.buckd/
.*/example/node_modules/react-navigation/.*/__tests__/.*
.*/example/node_modules/react-native-fbads

; Ignore duplicate modules under docs/
.*/docs/node_modules/fbjs/.*
.*/docs/node_modules/react/.*

[include]

Expand All @@ -44,6 +50,8 @@ experimental.strict_type_args=true

munge_underscores=true

module.name_mapper='^expo$' -> 'emptyObject'

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
Expand All @@ -58,4 +66,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true

[version]
^0.40.0
^0.40.0
2 changes: 1 addition & 1 deletion src/core/withTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type State = {
theme: Theme,
};

export default function withTheme<T>(Comp: ReactClass<T>): ReactClass<T> {
export default function withTheme<T: *>(Comp: ReactClass<T>): ReactClass<T> {
class ThemedComponent extends PureComponent<void, *, State> {
static displayName = `withTheme(${Comp.displayName || Comp.name})`;

Expand Down

0 comments on commit 4760ebb

Please sign in to comment.