Last active
September 27, 2017 07:48
-
-
Save wildeyes/e62dde6a091798e31385f1f332e61df2 to your computer and use it in GitHub Desktop.
How to annotate X in typescript
This file contains hidden or 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
// The Typescript language spec, https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md, is the definitive guide for | |
// how to annotate a react class, or anything else. But, sometimes, examples with a lot of SEO compatible words is better. | |
// Annotate a decorator that takes a react class, and wraps it. It'll have the same props as it's child. | |
export const decorateWithX = <T extends {}>(Comp: ComponentClass<T>): ComponentClass<T> => class extends PureComponent<T, State> { | |
} | |
// https://github.com/Microsoft/TypeScript/issues/4922 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment