мера не просмотр остальных данных в реагирует виртуализирован - PullRequest
1 голос
/ 23 февраля 2020

когда компонент смонтировал меру, отображается какой-то элемент, но при прокрутке браузера остальная часть элемента не отображается, но высота меры увеличивается, а остальная часть элемента скрыта

// Default sizes help Masonry decide how many images to batch-measure
  cache:any = new CellMeasurerCache({
    defaultHeight: 250,
    defaultWidth: 200,
    fixedWidth: false,

  });
  // Our masonry layout will use 3 columns with a 10px gutter between
  cellPositioner:any = createMasonryCellPositioner({
    cellMeasurerCache: this.cache,
    columnCount: 6,
    columnWidth: 200,
    spacer: 20,
  });
  cellRenderer = ({index, key, parent, style}:any) => {
    const list:any = this.state.styleFilteration;

    return (
      <CellMeasurer cache={this.cache} index={index} key={key} parent={parent}>

      <this.Text  style={style}  >   
        <this.Image onClick={()=> this.setState({show: true,forDetails: list[index]})}  >
           {list[index].favorite_beers.length == 0 ?
           <this.unFaverit  onClick={(e)=> {e.stopPropagation(); this.fav(list[index].id)}} ><i className="fa fa-heart"></i></this.unFaverit> :
           <this.Faverit onClick={(e)=> {e.stopPropagation(); this.unFav(list[index].id)} } ><i className="fa fa-heart"></i></this.Faverit>}
           </this.Image>
           <this.ImageName >{list[index].title}</this.ImageName>
       </this.Text>

      </CellMeasurer>
    );
  }

и мой рендер вернуть

<Masonry
   cellCount={this.state.styleFilteration.length}
   cellMeasurerCache={this.cache}
   cellPositioner={this.cellPositioner}
   cellRenderer={this.cellRenderer}
   height={800}
   width={1300}
   autoHeight
   data={this.state.styleFilteration}

/>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...