Collection of React Hooks returning components of antd.
- 🏄 Easy to use. You don't need to know too much about state and change methods to use components with interaction logic.
- 💅 Easy to customize. You can easily customize the combination of components you need.
- 👯 Layered design. You can use react-hooks without ui or react-hooks with antd.
- 🤾 Hooks return higher-order component (HOC). Crazy, but it does give you a more convenient api. At the same time you can choose not to use.
Usually, we use multiple antd components, and we organize their relationship through state and props methods like value
, onChange
.
Is there a way to reduce the process code and describe the relationship between multiple ui components? How can we use a way to use existing processes?
Yes,we can use react-hooks, so the relationship between multiple antd components will be in react-hooks.Further, we use HOC as the api, so we don't have to care about the state and methods.
This project is still under development.
Install the react-hooks you need
eg: @sunflower-antd/form-table
$ npm install @sunflower-antd/form-table --save
import { useFormTable } from '@sunflower-antd/form-table';
function Component(props) {
const { Form, Table } = useFormTable(config);
return <div>
<Form />
<Table />
</div>;
}
ReactDOM.render(<Component />, mountNode);
$ yarn
$ yarn bootstrap
$ yarn dev // dev
$ yarn build // build
$ yarn test // test