import React, { useState } from 'react'; import { DownOutlined, UpOutlined } from '@ant-design/icons'; import { Button, Col, Form, Input, Row, Select } from 'antd'; const { Option } = Select; 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( {i % 3 !== 1 ? ( ) : ( )} , ); } return children; }; const onFinish = (values: any) => { console.log('Received values of form: ', values); }; return (
{getFields()} { setExpand(!expand); }} > {expand ? : } Collapse
); }; const App: React.FC = () => (
Search Result List
); export default App;