I'm using office-ui-fabric-react
library. Current version that I'm on is 7.17.0.
My list is super simple:
<DetailsList
columns={this.state.columns}
items={this.state.items}
compact={true}
selectionMode={SelectionMode.none}
enableUpdateAnimations={true}
/>
When I change the items in a separate method (marked async) and do this.setState({items: someNewItems})
, the list doesn't get re-rendered. I'm curious is this a known issue, or is the DetailsList
needs to be handled in a special way?
To clarify, after executing this.setState
nothing changes, but if I resize the page, the new elements appear suddenly.
console.log(this.state.items)
on the render method, the changes are displayed? – Grouperthis
reference bound to it? ^ if you log the items and they don't change, try making your component's function an arrow function so it's bound to the component and can usethis.setState
. – Sayles