Y
Y
yankoyski2019-08-31 14:59:45
JavaScript
yankoyski, 2019-08-31 14:59:45

How does a component wrapped in @observer know which properties to watch?

Understanding how mobx works internally.
Interested in how the component learns to monitor the property store.testand reacts to changes?

import React, { Component } from 'react';
import { observer } from 'mobx-react';
import store from 'store/index';

export default @observer class extends Component {
  render() {
    return (
      <div>
        {store.test}
      </div>
    );
  }
};

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question