이벤트시 특정 필드의 값을 어떻게 변경할 수 있습니까?redux-form : 클릭시 특정 필드 값을 변경하십시오.
예 작동하지 (재산 정의의 'FIRSTNAME'을 읽을 수 없습니다)
onclick1() {
this.props.fields.firstname.onChange("John")
}
render() {
const { handleSubmit } = this.props;
return (
<div>
<form onSubmit={handleSubmit(this.submit.bind(this))}>
<Field
name="firstname"
component={TextField}
label="first name"
/>
<button onClick="this.onclick1()">Set name to John</button>
<button type="submit">
okay
</button>
</form>
이 솔루션은 여기에 제안했지만 나를 위해 https://stackoverflow.com/a/36916183/160059
REDUX 형태의 V7
작동하지 않습니다
양식은 어떻게 보이나요? 몇 가지 코드를 공유합니까? – Dario
@Dario 업데이트 된 예 – rendom