Last active
October 29, 2019 20:04
-
-
Save brianlovin/22be29883d4a40993b11c87c568eb04b to your computer and use it in GitHub Desktop.
Flow type function prop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// component | |
type AnotherType = { | |
data: { | |
id: string | |
} | |
} | |
type Props = { | |
aFunction: ({ id: string }) => AnotherType | |
} | |
class Foo extends React.Component<Props> { | |
doAThing = () => { | |
// this does not trigger a flow error | |
return this.props.aFunction('blahblah') | |
} | |
... | |
} |
bslipek
commented
Sep 7, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment