Created
October 18, 2021 23:33
-
-
Save Cogentx/405b1e8d02f640ec5aaa7bc897d434b0 to your computer and use it in GitHub Desktop.
React TypeScript Basic 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
| 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