Created
August 29, 2019 18:37
-
-
Save anderjs/d6f4906c8743708b1c35dbcec2bd7b9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DepartmentButton = ({ onMouseOver }) => { | |
<button onMouseOver={onMouseOver}>Example</button> | |
} | |
const App = () => { | |
const [classList, setClassList] = useState('inactive') | |
function onMouseOverHandler() { | |
if (!isMobileDevice()) { | |
setClassList('activo') | |
} | |
} | |
return ( | |
<React.Fragment> | |
<div className={classList} /> | |
<DepartmentButton onMouseOver={onMouseOverHandler} /> | |
</React.Fragment> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment