0
다음 검색어는 모두 이전 페이지 높이와 색인 수로 시작합니다. cellRenderer의 인덱스 개수와 새 검색 쿼리의 페이지 높이를 업데이트하려면 어떻게해야합니까? 다음 코드 도움이 오류를 방지 할 수 있지만, 문제가 해결되지 않습니다Masonry가 componentWillReceiveProps 메서드에서 셀의 인덱스 (cellCount)를 새로 고치지 않는 이유는 무엇입니까?
cellRenderer = ({index, key, parent, style}) => {
const image = this.props.images.items[index];
if (!image) {
console.log('!image (empty image with index: ', index, 'style', style);
return;
}
코드 :; :
// Clear any JIT measurements
cellMeasurerCache.clearAll();
// Reset the position cache
cellPositioner.reset({
columnCount: this.columnCount,
columnWidth: this.columnWidth,
spacer: this.spacer,
});
// Let Masonry know it needs to relayout
this.masonry.clearCellPositions();
브라이언, 빠른 응답과 대중화 React.js에 대한 귀하의 기여에 감사드립니다. 많은 사람들이 정말로 그것을 고맙게 생각합니다. 계속 올려! –