bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.12k stars 3.06k forks source link

Can I pass web Components as part of the row data #1732

Open Subha opened 2 years ago

Subha commented 2 years ago

Asking a Question?

We have been using react-virtualized for a while now, we started moving to use web components. When i add a web component inside the rowrenderer the height is not being recalculated . Is web components supported?

`private rowRenderer = ({ key, index, style, parent }) => (

{ // TODO: Per documentation, CellMeasurer allows children that are: // either a React element as a child (eg
) or a function (eg. ({ measure }) =>
). // but the available @types only allow a function child. Fix when newer @types are available. ({ measure, registerChild }) => (
{console.log(registerChild)} {(this.state.itemsFetched && this.state.itemsFetched[index]) ? this.props.renderItem(index, this.getContentModel(index), this.props.columns, this.props.rows, this.props.lockedColumns, this.props.lockedGrid, this.props.setRowHeights, this.props.handleHover, this.props.selectRow, this.props.handleRowClick) : '...'}
) }

);`

Added two scenarios

  1. Rendering web component the styles are not being measured properly. image

  2. Added a web component button with react content. When there is react content everything works as expected image

Please don't file GitHub issues to ask questions! Instead use: