Accepted answer

This problem is brought up in the Common pitfalls & best practices section of the documentation:

MobX observable objects do not detect or react to property assignments that weren't declared observable before. So MobX observable objects act as records with predefined keys. You can use extendObservable(target, props) to introduce new observable properties to an object. However object iterators like for .. in or Object.keys() won't react to this automatically. If you need a dynamically keyed object, for example to store users by id, create observable _map_s using

So instead of using extendObservable on an observable object, you could just add a new key to an observable map.


const {observable, action} = mobx;
const {observer} = mobxReact;
const {Component} = React;
class TestStore {
  mySimpleObject ={});

  @action addSimpleProperty = (value) => {
    this.mySimpleObject.set(value, {newProp: value});

class MyView extends Component {
  constructor(props) {
    this.handleAddSimpleProperty = this.handleAddSimpleProperty.bind(this);
  handleAddSimpleProperty(e) {

  render() { 
    var simpleObjectString = this.props.myStore.mySimpleObject.values();
    return (
        <h3> Simple Object</h3>
        { => e.newProp)}
        <button onClick={this.handleAddSimpleProperty}>Add Simple Property</button>

const store = new TestStore();
ReactDOM.render(<MyView myStore={store} />, document.getElementById('mount'));

Related Query

More Query from same tag