alibaba / x-render

🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案
https://xrender.fun
6.96k stars 986 forks source link

actionBtns not add footer dependencies #1481

Closed haoxutong closed 6 months ago

haoxutong commented 6 months ago

FormCore 这个组件定义的

const actionBtns = useMemo(() => { const result: React.JSX.Element[] = []; if (!footer?.reset?.hide) { result.push( <Button {...footer?.reset} onClick={() => form.resetFields()}> {footer?.reset?.text || t('reset')} ); } if (!footer?.submit?.hide) { result.push( <Button type='primary' onClick={form.submit} {...footer?.submit}> {footer?.submit?.text || t('submit')} ); } return result; }, []);

这里没有将 footer 添加进入依赖,会导致给 footer 的 按钮 添加 loading 状态切换不会成功,只能是初始化的值

lhbxs commented 6 months ago

1488