react-component / react-component/table
The problem of render return value in the columns configuration of the table
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 618
- Avg merge
- 10h 19m
- Merged PRs (30d)
- 2
Description
During the use of the latest version, I found that if the return value of the render function is an array, it will not render.
I checked the code:
// Not crash if final `childNode` is not validate ReactNode
if (typeof childNode === 'object' && !React.isValidElement(childNode)) {
childNode = null;
}
This code will fail to render. Do you have plans to modify the code like this to support returning array or is it no longer supported to return array?
if (Array.isArray(childNode)) {
childNode = childNode.filter((o) => React.isValidElement(o));
}
// Not crash if final `childNode` is not validate ReactNode
if (typeof childNode === 'object' && !Array.isArray(childNode) && !React.isValidElement(childNode)) {
childNode = null;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the render-value handling shown in the issue and reproduce a columns configuration whose render function returns an array. Check the resulting table output and existing validation behavior; done means valid React elements returned in arrays render without allowing invalid values to crash the table.
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
- Mostly clear
- Newbie friendliness
- 45/100