Applications are driven by state. Many things, like the user interface, should always be consistent with that state. MobX is a general purpose FRP library that provides the means to derive, for example, a React based user interface automatically from the state and keep it synchronized.
The net result of this approach is that writing applications becomes really straight-forward and boilerplate free.
What is the difference then, between passing the store as prop, and using it directly from the closure?
Downloaded the repo from: https://codesandbox.io/s/jj7rrm1q19
"Syntax error: Unexpected token (17:0)"
@observer class Counter extends Component {
••••••••••
Any ideas?
I get this same error.Unable to resolve it.
Probably you need to enable babel to parse the decorator syntax installing a plugin such as:
https://babeljs.io/docs/en/babel-plugin-proposal-decorators
I've just started this tutorial. But would try that.
Downloaded the repo from: https://codesandbox.io/s/jj7rrm1q19
"Syntax error: Unexpected token (17:0)"
@observer class Counter extends Component {
••••••••••
Any ideas?
Seems like CRA doesn't support decorators. https://facebook.github.io/create-react-app/docs/can-i-use-decorators
As I tried your sandbox with old v1.x react-script, it works but not with v2.x