reactjs - 警告:道具类型失败:提供给“编辑器”的“对象”类型的无效道具“值”,应为“字符串”
问题描述
<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)
解决方案
推荐阅读
- android - 如何使用Android FusedLocationProviderClient根据距离进行更新
- c - 为什么我收到 realloc(): invalid next size 错误?
- python - 使用 pandas.dataframe.values 将熊猫数据框转换为 numpy 数组
- python - 如何获取由列表 Python 中的项目组成的整数中的前导零
- rust - “预期结构 `std::rc::Rc`,找到参考” - 如何转换?
- java - 如何从 IntelliJ 生成的 jar 开始上课?
- javascript - 当前与 JS ES6 的活动链接
- sql - Rails Postgres 查询,仅选择出现在所有搜索参数中的具有关联的项目
- python - ImportError:没有名为 win32api 的模块错误
- django - 如何保存表单信息以使其显示在管理站点面板中?