Skip to content

Commit

Permalink
fix: Change Button interface to conform to the DOM interface
Browse files Browse the repository at this point in the history
  • Loading branch information
wmoai authored and nabeliwo committed Oct 31, 2019
1 parent 40d6ae3 commit 82003a2
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/components/Button/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,11 @@ import { isTouchDevice } from '../../libs/ua'
type Tag = 'button' | 'a'
type Size = 'default' | 's'

interface ClickEvent {
preventDefault: () => void
}

export interface ButtonProps extends BaseProps {
onClick?: (e: ClickEvent) => void
disabled?: boolean
}
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>

export interface AnchorProps extends BaseProps {
href: string
target?: string
rel?: string
}
export type ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size' | 'prefix'> &
BaseProps
export type AnchorProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'prefix'> & BaseProps

export interface BaseProps {
size?: Size
Expand Down

0 comments on commit 82003a2

Please sign in to comment.