import styles from "./index.less"; import React, { useState } from "react"; import { Form, Row, Col, Input, Button } from "antd"; import { DownOutlined, UpOutlined } from "@ant-design/icons"; const AdvancedSearchForm = () => { const [expand, setExpand] = useState(false); const [form] = Form.useForm(); const getFields = () => { const count = expand ? 10 : 6; const children = []; for (let i = 0; i < count; i++) { children.push( ); } return children; }; const onFinish = (values) => { console.log("Received values of form: ", values); }; return (
{getFields()} { setExpand(!expand); }} > {expand ? : } Collapse
); }; export default () => (
);