Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function test(props){
- console.log(props.data)
- return(
- <button
- onClick={()=>{
- props.data[1]="changed"
- props.forms.setFieldsValue({"comid":props.data})
- }}
- >
- </button>
- {props.data.map((ele,index)=>{
- getFieldDecorator(`comid[${index}]`,{
- initialValue:ele
- })(
- <input>
- )
- })}
- )
- }
- //after setFieldsValue({"comid":props.data}),it excutes console.log(props.data),and props is changed, but content of comid list has no change
Add Comment
Please, Sign In to add comment