Guest User

Untitled

a guest
Jan 12th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function test(props){
  2. console.log(props.data)
  3. return(
  4. <button
  5. onClick={()=>{
  6. props.data[1]="changed"
  7. props.forms.setFieldsValue({"comid":props.data})
  8. }}
  9. >
  10. </button>
  11. {props.data.map((ele,index)=>{
  12. getFieldDecorator(`comid[${index}]`,{
  13. initialValue:ele
  14. })(
  15. <input>
  16. )
  17. })}
  18. )
  19. }
  20.  
  21. //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