Reputation: 471
I tried to use Mobx to manage state in React Native Project(ADE is Expo).
I have just install Mobx and Mobx-react by npm.
But some article about Mobx I read is mentioning some decorators like legacy and ~~-0.
Now actually my Mobx sample code is working without decorators.
So, I am wondering these decorators are necessary or not in my Project? In addition to this, if these are necessary, why I should use these.
Upvotes: 0
Views: 165
Reputation: 732
JS decorators are essentially just syntactic sugar which currently are not part of the JS language but some transpilers such as Babel has integrated them in their latest implementations. Using them is totally your personal preference just like you can create a complete React app without using the JS classes. They make the code more readable. Since you are using Expo, you don't need to add anything to babel configurations to be able to use them. In my understanding Expo does this for you.
Upvotes: 1