norush-hooks
v1.0.1
Published
A react hooks tootls
Downloads
2
Maintainers
Readme
📦 安装
$ npm install --save norush-hooks
# or
$ yarn add norush-hooks
📚 Development
# install dependencies
$ npm install
# enable peoject
$ npm start
# or
$ npm run dev
🔨 Usage
import { Button, useBoolean } from 'norush-hooks';
import React from 'react';
export default () => {
const [state, { toggle, setTrue, setFalse }] = useBoolean(true);
return (
<div>
<p>Effects:{JSON.stringify(state)}</p>
<p>
<Button type="primary" onClick={toggle}>
Toggle
</Button>
<Button type="success" onClick={setFalse}>
Set false
</Button>
<Button type="info" onClick={setTrue}>
Set true
</Button>
</p>
</div>
);
};
LICENSE
MIT Copyright (c) 2023-05-20 Norush