Open pointhalo opened 1 year ago
看了下代码,是因为setValues的时候,组件因为隐藏状态,没有拿到组件,所以无法设置
建议先这么写
<div style={{display: formState.values.isAnchor === "yes" ? "none" : "block" }}>
<Form.Input
field={`tag`}
label="tag"
style={{ width: "100%"}}
></Form.Input>
</div>
Is there an existing issue for this?
Which Component
Form
Semi Version
No response
Current Behavior
复现前提:
现状: setValues 给Field( tag )设置的值(‘456’)无效,Field(tag)生效的是 它的initValue '123'
Expected Behavior
setValues 给Field( tag )设置的值(‘456’)后,生效的就是 456,而不是 initValue 123
Steps To Reproduce
ReproducibleCode
Anything else?
https://codesandbox.io/s/silent-wave-6zkgvq?file=/src/App.tsx
No response