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 230 forks source link

Migration to react 18 #940

Closed mod7ex closed 1 year ago

mod7ex commented 1 year ago

when working with the library in a react 18 project i keep getting this warnings in the console

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

I just want to know if it (react 18) will be supported in the future in next versions

victorheringer commented 1 year ago

Looks like this lib is been deprecated due to the merge with testing-library, but there is a PR to make it compatible with react 18, either way I guess the way is just migrate to react-testing-library renderHook, and this migration guide may help https://github.com/testing-library/react-hooks-testing-library/blob/chore/migration-guide/MIGRATION_GUIDE.md

MPSSreekar commented 1 month ago

when working with the library in a React 18 project i keep getting these warnings in the console

What changes should be done to render is not working after upgrading to React 18.

return render(

} /> , { wrapper: WrapperWithRouter, ...options } ); Do you know how I can change this? Your help is much appreciated I appreciate any help you can provide.