在创建可写输入字段时遇到问题。
import { Control } from "react-redux-form";
import { FormControl } from "react-bootstrap";
const existingItem = {
name: "John",
city: "Oakland",
};
<Control
component={FormControl}
model=".defaultItem"
componentClass="input"
id="original-item"
value={existingItem.name}
/>我的目标是显示一个输入字段,其中包含existingItem.name,以便我可以编辑和提交。
但是,使用value属性时,输入字段将变为只读。通常我会使用defaultValue,但在本例中,defaultValue会将输入字段呈现为可写但为空。
发布于 2018-02-17 07:48:36
很可能您的商店中不存在.defaultItem。
https://stackoverflow.com/questions/48836098
复制相似问题