-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Data are not displayed when "Column" has no "field" attributes #4248
Comments
Definitely a bug..great reproducer. |
Weird it works in Vite on StackBlitz also: https://stackblitz.com/edit/react-rhjloz?file=src%2FApp.js |
@melloware i found the difference (but not the actual explanation) between the CodeSandbox sample and the StackBlitz sample, the React strict mode. I you add the <React.StrictMode/> into the code sandbox, the code works; if you remove the <React.StrictMode/> from StackBlitz, the code fails. |
OK good we have seen other Strict Mode issues in the past as well. I marked it as "React 18" label and that will help us look for the issue. |
The Strict mode seems to involve a second rendering phase, which makes the code work. It could be a bug with badly initialised state? |
yep that is what it has been before something not initializing defensively. You can see some other StrictMode issues we have fixed before in this list: https://github.com/primefaces/primereact/issues?q=is%3Aissue+label%3A%22React+18%22+is%3Aclosed |
I think it's related to the |
OK can you try my fix. |
Sorry just posted: #4280 Can you try that and let me know. Locally it seems to be working in Strict Mode and non Strict Mode |
the |
It works for me, thanks. |
Describe the bug
I use DataTable with the callback "body" (without the "field" attribute); no data are displayed in this case (that workend with Prime 8.7.3).
Here is a test to reproduce the case (in addition to the CodeSandbox):
Reproducer
https://codesandbox.io/s/primereact-test-forked-btleh6
PrimeReact version
9.2.3
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: