@channelwill/hooks
TypeScript icon, indicating that this package has built-in type declarations

0.2.10 • Public • Published

Ready to use out of the box, no hassle.


npm package npm downloads demos

Installation

$ npm i @channelwill/hooks
# or
$ yarn add @channelwill/hooks
# or
$ pnpm add @channelwill/hooks

API Documentation

See https://hooks.baoea.com/

Tool Hooks

Base Hooks

DOM Hooks

Demo

在这里提供一些示例代码和演示,以帮助用户更好地理解如何使用这些 hooks。

链接地址

其中示例

import {useWindowSize, useEventListener} from '@channelwill/hooks';

const ExampleComponent = () => {
  const {width, height} = useWindowSize();

  const handleClick = () => {
    console.log('Window clicked!');
  };

  useEventListener('click', handleClick);

  return (
    <div>
      <h1>当前窗口大小: {width} x {height}</h1>
    </div>
  );
};

🤝 Participate in co-construction.

$ git clone git@github.com:Baoing/hooks.git

$ cd hooks

$ npm install

$ npm run start

Open browser access http://localhost:6006/

License

MIT License

Package Sidebar

Install

npm i @channelwill/hooks

Weekly Downloads

15

Version

0.2.10

License

ISC

Unpacked Size

106 kB

Total Files

123

Last publish

Collaborators

  • hubaoqing