📌 Device Orientation Event works only in HTTPS for security reasons.
npm i react-device-orientation-hook
import useDeviceOrientation from 'react-device-orientation-hook;
function Component() {
const { transformStyle, resetPivotOrientation } = useDeviceOrientation();
return (
<>
<div style={transformStyle} onClick={resetPivotOrientation} >
Hello World!
</div>
<p>Touch text and Revise orientation</p>
</>
);
}
npm run test
npm run build
To run a live-reload Storybook server on your local machine:
npm run storybook