testing-library/react-hooks-testing-library

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

mehrdad-shokri opened this issue · 1 comments

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-library version: ^8.0.1
  • react version: ^18.2.0
  • react-dom version (if applicable): ^18.2.0
  • ga version (if applicable):
  • node version: v18.12.1
  • npm (or yarn) version: 8.19.2