Skip to content

Warning: Can only update a mounted or mounting component. #25

@b27lu

Description

@b27lu

I check out master branch and try to run the ios version and get warning:

Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component.

The stack trace points to stock-cell.js line 84 and 92.

  componentDidMount() {
    StockStore.listen(state => this.onStockStoreChange(state));
  }

  componentWillUnmount() {
    StockStore.unlisten(state => this.onStockStoreChange(state));
  }

  onStockStoreChange(state) {
    this.setState({
      selectedProperty: state.selectedProperty,
      selectedStock: state.selectedStock,
    });
  }

And the stock price is empty.

I've tried one of solutions on stack overflow that using ref, but it didn't work for me. Could someone look into it? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions