Last active
January 15, 2019 23:06
-
-
Save Arfey/69f92a3182e6f859cc4a96716f93b7fc 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
import * as React from 'react'; | |
type ComponenProps = { | |
a: string; | |
}; | |
export function withLikeActions<T extends ComponenProps>(Component: React.ComponentType<T>): React.SFC<T> { | |
return (props: T) => ( | |
<Component {...props} /> | |
); | |
} | |
// first | |
type arrProps = { | |
a: number; | |
}; | |
const arr: React.SFC<arrProps> = () => (<div>text</div>); | |
// err | |
withLikeActions(arr); | |
// second | |
type arrProps2 = { | |
}; | |
const arr2: React.SFC<arrProps2> = () => (<div>text</div>); | |
// success | |
withLikeActions(arr2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment