the output provides quite a lot of warnings like this one:
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
38 | });
39 | it('should order ascending', () => {
> 40 | const { result } = renderHook(() =>
| ^
41 | useSort(data, { key: 'id', direction: 'ascending' })
42 | );
43 | act(() => result.current.requestSort('id'));
at console.error (node_modules/@testing-library/react-hooks/lib/core/console.js:19:7)
at printWarning (node_modules/react-dom/cjs/react-dom.development.js:86:30)
at error (node_modules/react-dom/cjs/react-dom.development.js:60:7)
at Object.render (node_modules/react-dom/cjs/react-dom.development.js:29670:5)
at node_modules/@testing-library/react-hooks/lib/dom/pure.js:80:18
at act (node_modules/react/cjs/react.development.js:2512:16)
at render (node_modules/@testing-library/react-hooks/lib/dom/pure.js:79:26)
at renderHook (node_modules/@testing-library/react-hooks/lib/core/index.js:114:5)
at Object.<anonymous> (src/table/__tests__/useSortable.test.tsx:40:34)
while running
the output provides quite a lot of warnings like this one:
the solution should be explained here: https://github.com/testing-library/react-hooks-testing-library#a-note-about-react-18-support
more explicitly:
A Note about React 18 Support If you are using the current version of react-testing-library, replace:
with
Once replaced, @testing-library/react-hooks can be uninstalled.