React Hooks with antd.
English | 简体ä¸æ–‡
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.
https://ant-design.github.io/sunflower/
$ npm install sunflower-antd --save
import { Form, Table } from 'antd';
import { useFormTable } from 'sunflower-antd';
function Component(props) {
const { formProps, tableProps } = useFormTable(config);
return <div>
<Form {...formProps} />
<Table {...tableProps} />
</div>;
}
ReactDOM.render(<Component />, mountNode);
# install
$ yarn
$ yarn bootstrap
# dev
$ yarn dev
# build
$ yarn build
# test
$ yarn test