I have an entity class called `order`

```js
const order = new Order({status: 'available'});

```

```js
export default class Order {
  constructor({status}) {
    this.status = status;
  }

  isCanceled() {
    return this.status === CANCELED;
  }
}

```

when passing `order` to a component throw `mapStateToProps`
when the status changes. `mapStateToProps` will be called again with the new status but the component will not be rendered with the new data

but if I passed the `order` as a standard object it will re-render with the new data

This code is not working

```js
const mapStateToProps = (state, props) => {
  const order = new Order({status: 'available'});

  return {
    order,
  };
};

```

This code works

```js
const mapStateToProps = (state, props) => {
  const order = new Order({status: 'available'});

  return {
    order: {...order},
  };
};

```

I need the first code to work as I use some functions from the object inside the component like `isCanceled()`