Created
November 15, 2019 12:56
-
-
Save skv-headless/0cdc36597d68576f2d3ff7f2941721fd 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'; | |
interface IUser { | |
id: number, | |
} | |
interface IProps { | |
name: string, | |
somethingOptional?: string, | |
age: number, | |
doSomething: (a: number) => number, | |
user: IUser, | |
children: React.ReactNode, | |
gender: 'male' | 'female', | |
parts: string[], | |
} | |
class Test extends React.Component<IProps, State> { | |
public render() { | |
return ( | |
<div> | |
Hello there! | |
</div> | |
); | |
} | |
} | |
export default Test; | |
<Test | |
name="name" | |
age={18} | |
doSomething={this.doSomething} | |
user={{ | |
id: 1 | |
}} | |
gender="male" | |
parts={['legs', 'head', 'arms']} | |
> | |
Inside test | |
</Test> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment