testing-library / react-hooks-testing-library

🐏 Simple and complete React hooks testing utilities that encourage good testing practices.
https://react-hooks-testing-library.com
MIT License
5.25k stars 233 forks source link

Warning: ReactDOM.render is no longer supported in React 18. #928

Closed mehrdad-shokri closed 1 year ago

mehrdad-shokri commented 1 year ago

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.

joshuaellis commented 1 year ago

Please see the readme – https://github.com/testing-library/react-hooks-testing-library#a-note-about-react-18-support