Skip to content

Instantly share code, notes, and snippets.

@FlorianPfisterer
Created October 27, 2017 05:27
Show Gist options
  • Save FlorianPfisterer/027910c0d6934ac103dc9ed60c704a62 to your computer and use it in GitHub Desktop.
Save FlorianPfisterer/027910c0d6934ac103dc9ed60c704a62 to your computer and use it in GitHub Desktop.
How to setup a Mobx + React web development environment so you can use @-decorators & Co.

Setup Mobx + React Dev Environment

create-react-app <app_name>
cd <app_name>
npm run eject
npm i -s mobx mobx-react babel-plugin-transform-decorators-legacy
touch .babelrc

Then put the following in your .babelrc:

{
  "presets": ["react"],
  "plugins": ["transform-decorators-legacy",
  "transform-class-properties"]
}

Now you can use @observable & Co. Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment