1.Warning: [antd: Form.Item] `children` is array of render props cannot have `name`:
Form.Item里面只能包裹一个“子”,多个“子”外面需要多嵌套一层Form.Item。
<FormItem> <FormItem name="XXX" ... > <Input /> </FormItem> <span>123</span> </FormItem>
2.Warning: Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?:
这是因为调用form方法时,Modal还未初始化导致form没有关联任何Form组件。
解决方法:Modal添加属性:forceRender(强制渲染 Modal)。
3.Warning: validateDOMNesting(...): <form> cannot appear as a descendant of <form>.:
如下是错误原因:
<Form> ... <Form></Form> ... </Form>
4.Invalid regular expression: /一个正则表达式/: Invalid group
部分浏览器不支持这种原生的双斜杠正则写法。
解决方法:换成new RegExp()的形式,其中如\d->\\d。
5.window.scrollTo失效的可能原因:
(1)touch-action: none; (2)height: 100%; (3)overflow(x/y): [hidden、auto、scroll];