@mojitonft/hooks
v1.0.5-alpha.5
Published
react hooks library
Downloads
8
Readme
✨ Features
- Easy to learn & use
- Contains a large number of advanced Hooks that are refined from business scenarios
- Written in TypeScript with predictable static types
📦 Install
$ npm install --save @mojitonft/hooks
# or
$ yarn add @mojitonft/hooks
🔨 Usage
import { MojitoHooksProvider, onErrorCallback, useServerTime } from '@mojitonft/hooks';
onErrorCallback((e) => {
// Log error to Sentry or anywhere you'd like:
console.error(e);
});
const Component: React.FC = () => {
const data = useServerTime();
return <pre>{ JSON.stringify(data, null, ' ')}</pre>;
};
const App: React.FC = () => {
return (
<MojitoHooksProvider>
<YourComponent />
</MojitoHooksProvider>
);
};