codegouvfr / react-dsfr

🇫🇷 The French Government Design system React toolkit
https://react-dsfr.codegouv.studio
MIT License
406 stars 51 forks source link

MUI DataGrid TrustedHTML problem #210

Closed garronej closed 9 months ago

garronej commented 9 months ago

Hello @lsagetlethias,

I was hoping maybe you could help me understand this. The Mui DataGrid no longer work in the Next App router test setup:

image

Any idea how to address this?

Thanks in advance for your help!

lsagetlethias commented 9 months ago

This is linked to trusted types policies and this error should only appears on Chrome (for now). Either MUI is now setting HTML to innerHTML without using trusted types (which is unsafe), or a error is thrown by something else, and the "catcher" (maybe ReactDOM) is trying to display the error with innerHTML.

Disabling trusted types in dev should, I think, resolve the issue.

garronej commented 9 months ago

yes let's go, after eading your answer I figured out that maybe upgrading MUI would solve the issue. Sure enough it did.
Thanks for the help!