Update Tooltip
This commit is contained in:
@ -29,7 +29,7 @@ Renders a tooltip component.
|
|||||||
```
|
```
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
function Tooltip({ children, text, ...rest }) {
|
const Tooltip = ({ children, text, ...rest }) => {
|
||||||
const [show, setShow] = React.useState(false);
|
const [show, setShow] = React.useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -38,12 +38,12 @@ function Tooltip({ children, text, ...rest }) {
|
|||||||
{text}
|
{text}
|
||||||
<span className="tooltip-arrow" />
|
<span className="tooltip-arrow" />
|
||||||
</div>
|
</div>
|
||||||
<div {...rest} onMouseEnter={() => setShow(true)} onMouseLeave={() => setShow(false)}>
|
<div onMouseEnter={() => setShow(true)} onMouseLeave={() => setShow(false)} {...rest}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
|
|||||||
Reference in New Issue
Block a user