Tomáš Gajdoš
03/03/2023, 10:37 AMsdk-ui
under React’s strict mode? I’ve tried the Dashboard component from @gooddata/sdk-ui-dashboard
and it fails to function as it is stuck in the loading state. It’s a pitty having to turn off strict mode for the project, because of GD components, but more importantly, it indicates some issues in your code, like unexpected side-effects or issues with component state management. Thanks!Jan Rehanek
03/03/2023, 12:00 PMIvan Mjartan
03/03/2023, 12:20 PMTomáš Gajdoš
03/03/2023, 12:22 PMIvan Mjartan
03/03/2023, 12:26 PMTomáš Gajdoš
03/03/2023, 12:31 PMTomáš Gajdoš
03/03/2023, 12:32 PMReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17
- from somewhere in InsightRendererCoreIvan Mjartan
03/03/2023, 12:33 PMJan Rehanek
03/03/2023, 12:36 PMTomáš Gajdoš
03/03/2023, 12:36 PMIvan Mjartan
03/03/2023, 12:39 PMTomáš Gajdoš
03/03/2023, 12:42 PMTomáš Gajdoš
03/03/2023, 12:52 PMvar events = [
{ name: "click", handler: "closeOnOutsideClick", target: document },
....
];
The issue is, that since this is at the top level of the file, if you’re doing SSR, it will crash your server, because document
doesn’t exist. It is OK to refer to document
in component or in functions called during component render, because if component render fails on the server, React will go ahead and just render the suspense and re-render the component on the client.
I personally don’t mind, because I load the GD components using React.lazy and keep a separate bundle, but maybe someone playing around with Next.js and GD might run into this.