Hello
I would like to display information during a MouseOver. But it seems it is not the right method to use :
return (
<div className="item" key={i}
onm ouseOver = {(e) => {
return (<div className="prompt">{variable}</div>)
}}
What would be the correct way ?
CodePudding user response:
const [showElement, setShowElement] = useState(false);
return (
<div className="item" key={i}
onm ouseOver = {(e) => {
setShowElement(true)
}}
>
{showElement && <div className="prompt">{variable}</div>
</div>
)