Skip to content

Commit

Permalink
refactor(ui/button): replace default props with TS default values
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefhruska committed Oct 16, 2020
1 parent 547689b commit 4e96b51
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/ui/src/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type TooltipProps = {
placement?: 'top' | 'right' | 'bottom' | 'left'
}

export const Tooltip: FC<TooltipProps> = ({ content, disabled, offset, placement, children, ...props }) => {
export const Tooltip: FC<TooltipProps> = ({ content, disabled = false, offset = 10, placement = 'top', children, ...props }) => {
const [isShown, setShown] = useState<boolean>(false)
const [hideTimeout, setHideTimeout] = useState<NodeJS.Timeout | null>(null)
const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null)
Expand Down Expand Up @@ -62,9 +62,3 @@ export const Tooltip: FC<TooltipProps> = ({ content, disabled, offset, placement
</div>
)
}

Tooltip.defaultProps = {
disabled: false,
offset: 10,
placement: 'top',
}

0 comments on commit 4e96b51

Please sign in to comment.