utsuboco / r3f-perf

Easily monitor your ThreeJS performances.
https://codesandbox.io/s/perlin-cubes-r3f-perf-wtp9t?file=/src/App.js
MIT License
602 stars 23 forks source link

React 18 support #25

Closed gregdingle closed 2 years ago

gregdingle commented 2 years ago

I'd like to use r3f-perf with the nearly released React 18. When I do, I get the warning

Warning: ReactDOM.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. Learn more: https://reactjs.org/link/switch-to-createroot
gregdingle commented 2 years ago

The problem seems to be this line https://github.com/utsuboco/r3f-perf/blob/6711a58a97fb4612457ecf548a0fdefccd6ce674/packages/r3f-perf/src/html.tsx#L65 .

RenaudRohlinger commented 2 years ago

Since React 18 is still in RC and R3F is still in v7 let's wait for r3f to go v8 to use createRoot. In the meantime, a patch would be easily possible depending on the version of React.

gregdingle commented 2 years ago

Sounds good. We've already patched our version of r3f-perf.

We could also submit a PR that is backwards compatible.

RenaudRohlinger commented 2 years ago

Oh, that would be awesome if you could PR patch.

RenaudRohlinger commented 2 years ago

updated r3f-perf@6.0.0 to v18 and r3f v8

gregdingle commented 2 years ago

Awesome!

DennisSmolek commented 2 years ago

Im still having this error with 6.0.1