day8 / re-frame-10x

A debugging dashboard for re-frame. X-ray vision as tooling.
MIT License
636 stars 68 forks source link

[Bug]: ReactJS 18 compatibility "ReactDOM.render is no longer supported in React 18" #367

Closed n2o closed 1 year ago

n2o commented 2 years ago

What happened?

10x uses the old react API, which is not working in ReactJS 18. The following error message appears:

image

To do this, we need to use the new functions for this. I built a project supporting the new react version and dropped 10x for this project: https://github.com/schnaq/cljs-re-frame-full-stack/blob/main/src/main/app/interface/core.cljs#L63-L67

10x Version

1.3.0

Reagent Version

1.1.1

React Version

18.1.0

re-frame Version

1.2.0

What browsers are you seeing the problem on?

Chrome

Relevant console output

`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`.
ceuk commented 1 year ago

Should just be a case of updating inject to use the new create-root and render functions from reagent.dom.client in Reagent 1.2.0 right?

rpofuk commented 10 months ago

I still get 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

Comming from day8.re-frame-10x.inlined-deps.reagent.v1v2v0.reagent.dom LN 17

image

I'm using {:mvn/version "1.9.3"}:

:preloads [devtools.preload day8.re-frame-10x.preload.react-18]