Update Tooltip

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-09-06 14:49:51 +03:00
parent e7dd2358d0
commit 75206e59d5

View File

@ -29,7 +29,7 @@ Renders a tooltip component.
```
```jsx
function Tooltip({ children, text, ...rest }) {
const Tooltip = ({ children, text, ...rest }) => {
const [show, setShow] = React.useState(false);
return (
@ -38,12 +38,12 @@ function Tooltip({ children, text, ...rest }) {
{text}
<span className="tooltip-arrow" />
</div>
<div {...rest} onMouseEnter={() => setShow(true)} onMouseLeave={() => setShow(false)}>
<div onMouseEnter={() => setShow(true)} onMouseLeave={() => setShow(false)} {...rest}>
{children}
</div>
</div>
);
}
};
```
```jsx