Created
May 2, 2019 17:06
-
-
Save antoniocapelo/042c4dfc5496aced661e8bba34a971d0 to your computer and use it in GitHub Desktop.
TSX component extending default HTML props
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 React from 'react'; | |
import { styled } from '@material-ui/styles'; | |
import AppBar from '@material-ui/core/AppBar'; | |
type CustomProps = { show: boolean }; | |
// Let's imagine MyComponent is a special type of button... | |
type MyComponentProps = CustomProps & React.HTMLProps<HTMLButtonElement>; | |
const MyComponent = ({show, ...rest}: MyComponentProps) => { | |
.... | |
} | |
export default HeaderBar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment