Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: Not accepting external components as children #4733

Closed
KajetanDobczyk opened this issue Aug 3, 2023 · 1 comment
Closed

DataTable: Not accepting external components as children #4733

KajetanDobczyk opened this issue Aug 3, 2023 · 1 comment
Labels
Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior

Comments

@KajetanDobczyk
Copy link

KajetanDobczyk commented Aug 3, 2023

Describe the bug

Hi! I've spent couple hours today on this bug, and I have no idea why it is happening... I have couple Dialogs where I use DataTable, and I wanted to make them generic. That is when I discovered this issue (very simplified):

When I pass the Columns to the DataTable from a function, or straight there, it works fine.

const items = [{id: "0"}]

(...)

<DataTable value={items}>
      <Column field="id" header="ID" />
    </DataTable>

When I do something like this, the data doesn't render at all...

const items = [{id: "0"}]

const Content = () => <Column field="id" header="ID" />;

(...)

<DataTable value={items}>
      <Content />
    </DataTable>

Reproducer

No response

PrimeReact version

9.2.0

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@KajetanDobczyk KajetanDobczyk added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 3, 2023
@melloware
Copy link
Member

Pretty sure this is related to:

#644

#1825

The real explanation i think is: #2052 (comment)

@melloware melloware added Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 4, 2023
@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants