0

I'm tring to write a customRowRendered for reactDataGrid but it is not well intepreted.

import React, { Component } from "react"
import ReactDOM from "react-dom";
import PropTypes from 'prop-types';
import ReactDataGrid from 'react-data-grid'

const RowRenderer = ({ renderBaseRow, ...props }) => {
    const color = props.idx % 2 ? "green" : "blue";
    return <div style={{ color }}>{renderBaseRow(props)}</div>;
};

render() {
return (
    <ReactDataGrid
            columns={columns}
            rowGetter={i => group.rows[i]}
            rowsCount={rows.length}
            minColumnWidth={40}
            rowRenderer={RowRenderer}
            rows={rows}
    />
);

}

The error is: this.props.renderBaseRow is not a function I read also this https://adazzle.github.io/react-data-grid/docs/examples/render-base-row but I can't resolve the problem Without the RowRenderer all works correctly

Anyone have suggestions? I'm sure that I'm not using correctly the component

1 Answers1

0

Just recently ran into this. Can fix it by updating ReactDataGrid. I'm not sure what version they implemented renderBaseRow on, but the error went away when i updated to 5.0.3.