Browse Source

fix code sample in the Form component doc (issue #9591) (#9705)

* fix code sample in the Form component doc (issue #9591)

* fix wrong space indent

* add trailing comma
pull/9832/head
pellea 7 years ago
committed by 偏右
parent
commit
b61f4c1ad3
  1. 6
      components/form/demo/global-state.md

6
components/form/demo/global-state.md

@ -58,9 +58,9 @@ class Demo extends React.Component {
},
};
handleFormChange = (changedFields) => {
this.setState({
fields: { ...this.state.fields, ...changedFields },
});
this.setState(({ fields }) => ({
fields: { ...fields, ...changedFields },
}));
}
render() {
const fields = this.state.fields;

Loading…
Cancel
Save