gothinkster / react-mobx-realworld-example-app

Exemplary real world application built with React + MobX
https://react-mobx.realworld.io/
MIT License
1.25k stars 266 forks source link

React Updates and LifeCycle Cleanup #18

Closed cfilby closed 7 years ago

cfilby commented 7 years ago

The goal of this PR is address issue #14 and update some project dependencies (such as bumping React to v16).

I tried to review the existing LifeCycle methods and the actions being dispatched and left synchronous actions in the componentWillMount method and moved async actions to componentDidMount. There might be some cases where it's worth consolidating store methods that are frequently used together, (ex: EditorStore's setArticleSlug and loadInitialData), but I mostly tried to keep the changes simple.

I updated the project dependencies, however I did not try to update the project to leverage any of the new React 16 functionality.

I also changed the extension on profileStore from .jsx to .js for consistency.

Please let me know if there's anything I can do to improve the PR or improve code clarity!

andykog commented 7 years ago

Thanks!