Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 27-mobx-data/a-sync-to-async/src/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UserStore from './UserStore';
@inject(({ store }, { user }) => {
return {
store,
user: user || (store && store.user)
user
};
})
@observer
Expand All @@ -31,7 +31,7 @@ class Form extends Component {
}

render() {
const { user } = this.props.store;
const { user } = this.props;
const { renderField, submit } = this;

return (
Expand Down Expand Up @@ -74,10 +74,10 @@ class Form extends Component {

@action.bound
handleFieldChange(e) {
const { onChange, store } = this.props;
const { onChange, user } = this.props;
const { name, value } = e.target;

store.user[name] = value;
user[name] = value;

if (onChange) {
onChange({ [name]: value });
Expand Down