From be4bd0d2856ffb95ba5156afec658de4bc993047 Mon Sep 17 00:00:00 2001 From: Mitchell Simoens Date: Tue, 27 Mar 2018 14:17:00 -0400 Subject: [PATCH] Fix loading user --- 27-mobx-data/a-sync-to-async/src/Form.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/27-mobx-data/a-sync-to-async/src/Form.js b/27-mobx-data/a-sync-to-async/src/Form.js index 18bd13f..d956474 100644 --- a/27-mobx-data/a-sync-to-async/src/Form.js +++ b/27-mobx-data/a-sync-to-async/src/Form.js @@ -19,14 +19,12 @@ class Form extends Component { @action componentDidMount() { const { store, user, userId } = this.props; - - store.user = user; if (store.fetchUser && userId) { store .fetchUser(userId) - .then(userData => (store.user = userData)) - .catch(e => console.log(e)); + .then(userData => Object.assign(user, userData)) + .catch(console.log); } }