{"record":{"id":"b04eb581116c1247","repo":"bvaughn/react-virtualized","slug":"rendered-cell-should-include-style-property-for-po","errorCode":null,"errorMessage":"Rendered cell should include style property for positioning.","messagePattern":"Rendered cell should include style property for positioning\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"source/Grid/defaultCellRangeRenderer.js","lineNumber":170,"sourceCode":"\nfunction warnAboutMissingStyle(parent, renderedCell) {\n  if (process.env.NODE_ENV !== 'production') {\n    if (renderedCell) {\n      // If the direct child is a CellMeasurer, then we should check its child\n      // See issue #611\n      if (renderedCell.type && renderedCell.type.__internalCellMeasurerFlag) {\n        renderedCell = renderedCell.props.children;\n      }\n\n      if (\n        renderedCell &&\n        renderedCell.props &&\n        renderedCell.props.style === undefined &&\n        parent.__warnedAboutMissingStyle !== true\n      ) {\n        parent.__warnedAboutMissingStyle = true;\n\n        console.warn(\n          'Rendered cell should include style property for positioning.',\n        );\n      }\n    }\n  }\n}\n","sourceCodeStart":152,"sourceCodeEnd":177,"githubUrl":"https://github.com/bvaughn/react-virtualized/blob/c737715486f724586aee8870ebea1e9efb7b0bfe/source/Grid/defaultCellRangeRenderer.js#L152-L177","documentation":"Grid's default cell range renderer warns (once per Grid instance) when a cell rendered by `cellRenderer` has no `style` prop. Grid positions cells absolutely via the injected `style`; without it cells overlap at the top-left corner and scrolling breaks visually. The check triggers only in development and only the first time.","triggerScenarios":"A custom `cellRenderer` that builds its own JSX and omits `{...style}` or `style`; destructuring the cellRenderer props and dropping `style`; a cellRenderer that returns a fragment or wrapper that doesn't apply the style to the outermost rendered element.","commonSituations":"Custom cell renderers for formatting (badges, links) that recreate the container div; migrating cellRenderers between react-virtualized components; forgetting spread of remaining props.","solutions":["Spread the injected `style` onto the outermost element your cellRenderer returns.","If using a wrapper component, forward the style to the DOM element it renders.","Ensure `key` and `style` props passed to cellRenderer are applied, not ignored."],"exampleFix":"// before\ncellRenderer={({key, style}) => <div key={key}>{cell}</div>}\n\n// after\ncellRenderer={({key, style}) => <div key={key} style={style}>{cell}</div>}","handlingStrategy":"validation","validationCode":"const safeCellRenderer = (props) => {\n  if (!props.style) console.warn('cellRenderer dropped style for index', props.index);\n  return <div {...props}>{renderCell(props)}</div>;\n};","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always spread the injected style onto the outermost cell element","Keep custom rendering inside a fixed shell that applies style","Test custom cellRenderers against Grid scroll behavior"],"tags":["grid","cellrenderer","style","layout"],"backgroundTag":"missing-style-prop-on-virtualized-cell","analyzedSha":"c737715486f724586aee8870ebea1e9efb7b0bfe","analyzedAt":"2026-08-30T00:33:38.249Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}