Seeing this bug locally, and was able to reproduce it in CodeSandbox:
- Open this demo in CodeSandbox https://www.telerik.com/kendo-react-ui/components/grid/pdf-export/#toc-getting-started (original sandbox link: https://codesandbox.io/p/sandbox/proud-snow-z89k2q?)
- Ensure Dependencies includes React 18
- Make these changes to the bottom of main.jsx:
- Comment out this line:
ReactDOM.render(<App />, document.querySelector('my-app'));
- Add these three lines in place of the above one:
const container = document.querySelector('my-app');
const root = createRoot(container); // createRoot(container!) if you use TypeScript
root.render(<App />);
A finished Sandbox in case it saves you some time -- https://stackblitz.com/edit/react-epnjnd?file=app%2Fmain.jsx
- Notice that the first sandbox on page load gives the React 17/18 react-dom.render() issue. In contrast, the finished sandbox doesn't give the React 17/18 issue. This behavior is to be expected.
- Click on "Export PDF" button. You now get the React 17/18 error on both sandboxes. You'd expect the error not to show up on the finished sandbox, as the parent code no longer utilizes the "old way of rendering React".