Skip to content

Doesn't sort when props.data changes #210

@ishmulyan

Description

@ishmulyan

Let's say we have Container which renders table of products which are updating with some interval.

class Container extends React.Component {
  constructor(props) {
    super(props);

    this.state = { products: productsGenerator() };

    //async update of products
    setInterval(() => this.setState({ products: productsGenerator() }), 1000);
  }

  render() {
    return (
      <div>
        <BootstrapTable keyField="id" data={ this.state.products } columns={ columns } />
        <Code>{ sourceCode }</Code>
      </div>
    );
  }
}

export default Container;

Since BootstrapTable uses props.data for passing sorted data instead of the state it makes the case described above not possible to implement.
Is this intended behavior?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions