Skip to content

Instantly share code, notes, and snippets.

@istarkov

istarkov/withProps.js

Last active Sep 3, 2017
Embed
What would you like to do?
// 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
You can’t perform that action at this time.