Skip to content

Instantly share code, notes, and snippets.

@delwar2016
Created November 11, 2016 20:55
Show Gist options
  • Save delwar2016/640c51d3633ea811097c299b41d73d24 to your computer and use it in GitHub Desktop.
Save delwar2016/640c51d3633ea811097c299b41d73d24 to your computer and use it in GitHub Desktop.
How to install mobx in create-react-app
1) Run create-react-app.
2) Run npm run eject.
3) Run npm install --saveDev babel-plugin-transform-decorators-legacy.
4) Open package.json, find the "babel" section (line 78 for me), and add 4 lines so it looks like this:
"babel": {
"plugins": [
"transform-decorators-legacy"
],
"presets": [
"react-app"
]
},
5) Run npm install --save mobx mobx-react. This installs MobX.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment