import {
PageContainer,
ProFormSelect,
StepsForm,
} from '@ant-design/pro-components';
import type { FormInstance } from 'antd';
import { Card} from 'antd';
import React, { useRef, useState } from 'react';
import type { StepDataType } from './data.d';
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
分步表单,分成两步骤,第二步依赖第一步的选择结果,异步请求数据。当前在第一步时,第二步的request就执行了。
🏞 期望结果
进入当前步骤时StepForm才开始请求
💻 复现代码
import { PageContainer, ProFormSelect, StepsForm, } from '@ant-design/pro-components'; import type { FormInstance } from 'antd'; import { Card} from 'antd'; import React, { useRef, useState } from 'react'; import type { StepDataType } from './data.d';
const StepForm: React.FC<Record<string, any>> = () => { const [current, setCurrent] = useState(0); const formRef = useRef();
return (
); }; export default StepForm;
© 版本信息
🚑 其他信息
直接官网拉的模版,不知道这算是featrue还是bug,希望得到解决方案。