Skip to content

customComponent of type object supplied to ColumnDefinition, expected function. in ColumnDefinition in new griddle-react #864

Open
@mkotar

Description

@mkotar

Griddle version

"griddle-react": "1.13.1", but tested also on "1.13.0"
"react-redux": "^7.2.0",

Actual Behavior

Failed prop type: Invalid prop customComponent of type object supplied to ColumnDefinition, expected function.
in ColumnDefinition

Any idea how to fix it ? Code is basically copied from documentation and still getting this error

Steps to reproduce

<ColumnDefinition id="serialNumber"
                                                         title={translate('recorders.serialNumber')}
                                                          customComponent={enhancedWithRowData(this.getRecorderSerialNumber)}
                                                          width={50}/>

and

private getRecorderSerialNumber = ({rowData}) => {
        return (
            <div className={style.link}>
                <Link to={`/recorders/${rowData.id}/view`}>{rowData.serialNumber}</Link>
            </div>
        );
    };
        enhancedWithRowData: connect((internalState: any, props: any) => {
            return {
                rowData: rowDataSelector(internalState, props)
            };
        }),
export const rowDataSelector = (state: any, params: any) => {
    return state
        .get('data')
        .find(rowMap => rowMap.get('griddleKey') === params.griddleKey)
        .toJSON();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions