Last active
February 9, 2019 21:37
-
-
Save treyhuffine/3041c38c1c97a18408ae97ad09224053 to your computer and use it in GitHub Desktop.
A TypeScript functional component
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
import * as React from 'react'; | |
interface IProps { | |
name?: string; | |
} | |
const Header: React.FC<IProps> = (props: IProps) => ( | |
<h1>Hello, {props.name}! Welcome to React and TypeScript.</h1> | |
); | |
Header.defaultProps = { | |
name: 'world', | |
}; | |
export default Header; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment