-
Notifications
You must be signed in to change notification settings - Fork 539
Make @rerun-io/web-viewer-react
compatible with React 19
#10809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
export default class WebViewer extends React.Component { | ||
/** @type {React.RefObject<HTMLDivElement>} */ | ||
#parent = createRef(); | ||
#parent = /** @type {React.RefObject<HTMLDivElement>} */ (createRef()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this annotation was the only thing that broke when switching to React 19. The fix is what the ai suggested and it seems to work just fine 🤷
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but kind of hard to tell which subtleties still lie in Javascript package management...
Thanks for testing for BW-compat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
peerDependencies
is a nice touch.
* Fixes #10736 .. and use `peerDependencies` instead of `dependencies` as it is common practice in the ecosystem. Tested by building building with dev dependencies pointing to React 18 & 19 as well as a minimal example app using either react 18 or 19 and printing the active react version number: ```ts import WebViewer from "@rerun-io/web-viewer-react"; import React from "react"; function App() { console.log("React version:", React.version); return ( <div style={{ width: "100vw", height: "100vh" }}> <WebViewer width="800px" height="600px" rrd="https://app.rerun.io/version/0.24.0/examples/arkit_scenes.rrd" /> </div> ); } export default App; ``` with either ```json "dependencies": { "@rerun-io/web-viewer-react": "file:../rerun/rerun_js/web-viewer-react", "react": "^18.3.1", "react-dom": "^18.3.1" }, ``` or ```json "dependencies": { "@rerun-io/web-viewer-react": "file:../rerun/rerun_js/web-viewer-react", "react": "^19.0.0", "react-dom": "^19.0.0" }, ``` --------- Co-authored-by: Emil Ernerfeldt <[email protected]>
Related
What
.. and use
peerDependencies
instead ofdependencies
as it is common practice in the ecosystem.Tested by building building with dev dependencies pointing to React 18 & 19 as well as a minimal example app using either react 18 or 19 and printing the active react version number:
with either
or