x-render icon indicating copy to clipboard operation
x-render copied to clipboard

actionBtns not add footer dependencies

Open haoxutong opened this issue 1 year ago • 0 comments

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')} </Button> ); } if (!footer?.submit?.hide) { result.push( <Button type='primary' onClick={form.submit} {...footer?.submit}> {footer?.submit?.text || t('submit')} </Button> ); } return result; }, []);

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

haoxutong avatar Feb 22 '24 06:02 haoxutong