A zero dependency, React utility library, filled with useful hooks to make your React experience even better.
npm install origen
useBoolValue
true and false;
js
import { useBoolValue } from 'origen';
export default function App() {
const [value, toggleValue] = useBoolValue(false);
return (
My value is: {value}
);
}
`
---
#### useMousePosition
> For getting the current x and y coordinates of the mouse cursor.
`js
import { useMousePosition } from 'origen';
export default function App() {
const mousePosition = useMousePosition();
return (
Width: {mousePosition.x}
Height: {mousePosition.y}
);
}
`
---
#### useWindowDimensions
> For getting the current width and height values of the window.
`js
import { useWindowDimensions } from 'origen';
export default function App() {
const dimensions = useWindowDimensions();
return (
Width: {dimensions.width}
Height: {dimensions.height}
);
}
``