react-beautiful-dnd-grid
react-beautiful-dnd-grid copied to clipboard
Not rerender grid if change props maxItems
<ListManager
items={this.pages}
direction="horizontal"
maxItems={this.props.imageSize}
render={this.$renderImageView}
onDragEnd={this.handleDrop}
/>
@malytinKonstantin did solve this issue ?!
did anyone able to solve this ?
did anyone able to solve this ?
use cann add componentdisupdate to listen for the change of maxItems componentDidUpdate(prevProps: Omit<P, Props> & WithMaxItemsProps) { if (prevProps.maxItems !== this.props.maxItems || prevProps.items !== this.props.items) { const maxItems = this.props.maxItems && this.props.maxItems > 0 ? this.props.maxItems : this.props.items.length
this.setState({
maxItems,
items: this.props.items,
chunks: splitItems(maxItems, this.props.items, createId)
})
}
}