Momentarily, this is a React Hooks library that provides a set of hooks to help you build your React applications. Opportunely this library can migrate to a full-fledged UI with hooks library in the future. It's a work in progress, and we are working hard to make it better every day.
To install the package, run:
npm install globojs
yarn add globojs
pnpm add globojs
bun add globojs
To use the package, import the package and use the hooks:
import { useClickOutside } from 'globojs';
function App() {
const ref = useRef();
useClickOutside(ref, () => {
console.log('Clicked outside');
});
return <div ref={ref}>Click outside me</div>;
}
See the Demo
See the Repository to see the source code.
See the Changelog to see the latest changes.
This library was created by Luciano Giraudi. He is a full-stack developer and loves to build things that help others.