Warning: ReactDOM.render is no longer supported in React 18.
mehrdad-shokri opened this issue · 1 comments
mehrdad-shokri commented
Hello when I run my tests written with @testing-library/react-hooks I get the following error in my Terminal:
● Console
console.error
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
26 | },
27 | ]
> 28 | const {result} = renderHook(() =>
|
And it's highlighting the renderHooks method.
react-hooks-testing-libraryversion: ^8.0.1reactversion: ^18.2.0react-domversion (if applicable): ^18.2.0gaversion (if applicable):nodeversion: v18.12.1npm(oryarn) version: 8.19.2
joshuaellis commented
Please see the readme – https://github.com/testing-library/react-hooks-testing-library#a-note-about-react-18-support