question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider refactoring <Table /> not to use children prop for column specification

See original GitHub issue

I’m working on a datatable implementation which is based off (forks) <Table /> code.

I think <Table /> code itself could be simplified (and even be more performant probably) if it uses columns prop (being an array column specifications, just POJSO objects) instead of children with pseudo-React elements.

For example all those calls to React.Children.forEach/map will go away. What do you think?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bvaughncommented, Sep 23, 2016

It is a reasonable suggestion though. I’ll think on it a bit more. If you’d like to toss up a PR with a suggested implementation in the meanwhile- (one that maintains backwards compat)- I’d be happy to look over it and further consider.

0reactions
bvaughncommented, Sep 23, 2016

lol, no worries. I understood what you meant. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is React saying "Invalid prop `children`"? - Stack Overflow
It appears that rendering a single child in react follows different semantics than rendering multiple children and PropTypes should be updated accordingly.
Read more >
Tested React: Let's build a Data Table | by Gasim Gasimzada
In our case, it doesn't really matter because DataTable component cannot have children.
Read more >
Specification, Implementation and Verification of Refactorings
Refactoring is the process of reorganising or restructuring code by means of behaviour-preserving program transformations, themselves called refactorings.
Read more >
Breaking changes in v5, part two: core components - Material UI
As the core components use Emotion as their style engine, the props used by ... they are considered deprecated CSS properties by the...
Read more >
Table | Element Plus
After setting attribute data of el-table with an object array, you can use prop (corresponding to a key of the object in data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found