Last active
September 3, 2017 18:35
-
-
Save istarkov/d0f3bef0a7349b5e62289abe0fa5cd77 to your computer and use it in GitHub Desktop.
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
// change output type of withProps | |
// from `HOC<A & B, B>` to `HOC<{ ...$Exact<B>, ...A }, B>` | |
type EnhancedCompProps = { b: number } | |
const enhancer2: HOC<*, EnhancedCompProps> = compose( | |
withProps(({ b }) => ({ | |
b: `${b}`, | |
})), | |
withProps(({ b }) => ({ | |
// $ExpectError The operand of an arithmetic operation must be a number | |
c: 1 * b, | |
})) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment