Problems with React18 and PrimeReact v8

UI Components for React
Post Reply
X1X11X
Posts: 16
Joined: 05 Mar 2022, 21:37

26 May 2022, 23:34

Hi, with the update to React 18 a few issues have arisen in my project regarding PrimeReact.

First, I can't have more than one child in a div element, the following error appears:
TS2746: This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided.
Image

Likewise, I can no longer render a Column[] in a DataTable, this is where the error in the screenshot occurs.
Image
Could it be that here the 18 version of React makes problems, or are here with the PrimeReact v8 breaking changes added?

Thanks in advance!

X1X11X
Posts: 16
Joined: 05 Mar 2022, 21:37

27 May 2022, 18:51

After further trying around it looks like this is caused by React18, with React17 and PrimeReact v8 everything runs fine.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

29 May 2022, 13:52

Yep I answered on Stack Overflow how to fix it for React 18. https://stackoverflow.com/questions/724 ... r-accepted
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests