react-component / react-component/table

expandedRowRender does not exit...

Open
#400 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
618
Avg merge
10h 19m
Merged PRs (30d)
2

Description

能帮我看下这是为什么吗?很感谢!
版本: rc-table: ^6.10.1
尝试的例子:

import React from 'react';
import Table from 'rc-table';

const columns = [
    {
        title: 'title1',
        dataIndex: 'a',
        className: 'a',
        key: 'a',
        width: 100,
    },
    {
        id: '123',
        title: 'title2',
        dataIndex: 'b',
        className: 'b',
        key: 'b',
        width: 100,
    },
    {
        title: 'title3',
        dataIndex: 'c',
        className: 'c',
        key: 'c',
        width: 200,
    },
    {
        title: 'Operations',
        dataIndex: '',
        className: 'd',
        key: 'd',
        render() {
            return <a href="#">Operations</a>;
        },
    },
];

const data = [
    { a: '123', key: '1' },
    { a: 'cdd', b: 'edd', key: '2' },
    { a: '1333', c: 'eee', d: 2, key: '3' },
];

const Demo = () => (
    <div>
        <h2>rowClassName and className</h2>
        <Table
            columns={columns}
            rowClassName={(record, i) => `row-${i}`}
            expandedRowRender={record => <p>extra: {record.a}</p>}
            expandedRowClassName={(record, i) => `ex-row-${i}`}
            data={data}
            className="table"
        />
    </div>
);

export default Demo;

报的错误:
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied rc-table 6.10.1 React reproduction with the shown columns, data, and expandedRowRender settings. Inspect the reported error in the linked screenshot and trace the expanded-row behavior from there; done means the reproduction no longer produces the reported failure and expandedRowRender behaves as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.