@pdf-viewer/react
Version:
A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.
14 lines (13 loc) • 389 B
JavaScript
import { useCallback as e } from "react";
import { useRotationContext as a } from "../../contexts/RotationContext.js";
const l = () => {
const { setRotate: t } = a(), n = e(() => {
t((o) => (o + 90) % 360);
}, [t]), s = e(() => {
t((o) => (o - 90 + 360) % 360);
}, [t]);
return { handleRotateClockwise: n, handleRotateCounterclockwise: s };
};
export {
l as useRotate
};