<Form
form={form}
initialValues={{
content: postDetail.content,
}}
onFinish={onFinish}
>
<Form.Item name="content">
<Editor onEditorChange={handleEditorChange} init={INIT} />
</Form.Item>
<Form.Item>
<StyledButton htmlType="submit" type="primary" height={45} width={240}>
Submit
</StyledButton>
</Form.Item>
</Form>
我使用tinymce
编辑器结合antd设计形式来创建创建帖子页面。
当我加载页面并在编辑器中更改一些文本时,调试器将显示警告,如以下代码所示。我如何解决:
Warning: Failed prop type: Invalid prop `value` of type `object` supplied to `Editor`, expected `string`.
in Editor (at CreateForm/index.jsx:151)
in Field (created by WrapperField)
in WrapperField (created by FormItem)
in FormItem (at CreateForm/index.jsx:150)
in div (created by styled.div)
in styled.div (at CreateForm/index.jsx:138)
in div (created by Context.Consumer)
in Col (at CreateForm/index.jsx:137)
in div (created by Context.Consumer)