react-device-detect
react-device-detect copied to clipboard
useMobileOrientation not working
-
Bug description When I tried to use "const { isLandscape } = useMobileOrientation()", I get "TypeError: Object(...) is not a function"
-
Steps to reproduce import { useMobileOrientation } from 'react-device-detect'; const { isLandscape } = useMobileOrientation();
I had the same thing, then I updated react-device-detect to the latest version and tried it a bunch of times but it didn't work. A bit later after restarting my computer I tried with the exakt same code (I had ut commented the code out so I just uncommented it) and suddenly it worked. 🤷
It's works with version : 2.1.2
//...
import { useMobileOrientation } from 'react-device-detect';
function App() {
const mobileOrientation = useMobileOrientation();
console.log( "Check in console ->", mobileOrientation )
//..