Last active
May 5, 2018 20:59
-
-
Save jtmthf/b114489f1a83324a59e5e4af19bdf62f 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
class Any<T = 'div'> extends Component<Props<T>> { | |
public static ofType<T>() { | |
return Any as Constructor<Any<T>>; | |
} | |
public render() { | |
const { is: Cmp = 'div', innerRef, ...props } = this.props as any; | |
return <Cmp ref={innerRef} {...props} />; | |
} | |
} | |
type Constructor<T = {}> = new (...args: any[]) => T; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment