reactpy-django icon indicating copy to clipboard operation
reactpy-django copied to clipboard

Use `ReactDOM.createRoot` instead of `ReactDOM.render`

Open ZeroIntensity opened this issue 1 year ago • 3 comments
trafficstars

Description

ReactDOM.render is deprecated as of React 18 (see here), and removed in React 19 (see here). This switches to the alternative, ReactDOM.createRoot(...).render(<Root />).

Checklist

Please update this checklist as you complete each item:

  • [x] Tests have been developed for bug fixes or new functionality.
  • [x] The changelog has been updated, if necessary.
  • [x] Documentation has been updated, if necessary.
  • [x] GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

ZeroIntensity avatar Jun 02 '24 18:06 ZeroIntensity

Looks like this change broke the testing suite.

Maybe the ReactJS version needs to be bumped to support this?

Archmonger avatar Jun 03 '24 00:06 Archmonger

Could be, but looking at the package lock, it seems to be in React 17, so it should support this. I'm not sure how the testing suite it set up, but createRoot supposedly takes control of the DOM node somehow. Perhaps that's screwing things up?

ZeroIntensity avatar Jun 03 '24 00:06 ZeroIntensity

Scratch that - createRoot was added in React 18, not 17, so yeah, it's the version.

ZeroIntensity avatar Jun 03 '24 00:06 ZeroIntensity

Closing in favor of #285

Archmonger avatar Jun 14 '25 12:06 Archmonger