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.26k stars 233 forks source link

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

Closed mehrdad-shokri closed 2 years ago

mehrdad-shokri commented 2 years 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 2 years ago

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