Created
October 18, 2021 23:34
-
-
Save over40dev/3f2bfc95f4a3a31f685c454d8e2c816c to your computer and use it in GitHub Desktop.
React TypeScript Basic Component
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
interface Props { | |
title : string | |
color?: string | |
} | |
const Header = (props : Props) => { | |
return ( | |
<header> | |
<h1 | |
style={{ | |
color: props.color | |
? props.color | |
: 'blue' | |
}}>{props.title}</h1> | |
</header> | |
) | |
} | |
export default Header; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment