Updating to mobx 6 and keeping decorators

BASARAT
Nov 18, 2020

Just a quick one. Here’s what I had to do:

npm i jscodeshift mobx-undecorate

And then run:

cd src
npx mobx-undecorate --keepDecorators

And now anything that had decorators gets the `makeObservable(this)` call generated.

PS: I got the error:

node_modules/.bin/jscodeshift: No such file or directory

To fix it I just edited node_modules/.bin/mobx-undecorate to be:

// WAS : path.join("node_modules/.bin/jscodeshift")
path.join("jscodeshift"),

More

Enjoy 🌹

--

--