-
Notifications
You must be signed in to change notification settings - Fork 232
renderHook() results in: Warning: ReactDOM.render is no longer supported in React 18. #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please see the note in the README about react 18 support. The RTL PR has been merged now, so if you’ve updated your app and other tests to React 18, you should be ready to migrate your |
I am still getting the warning I tried wrapping let hook: RenderHookResult<any,any>;
act(() => {
hook = renderHook(myHook);
});
const { result } = hook; // Here I get typescript error saying: "Trying to use variable before it's assigned" |
It would be worked.
|
Yeah, I changed import { renderHook, act } from '@testing-library/react-hooks'; |
I'm getting the React 18 createRoot warning when using renderHook. I've updated my app to react 18 already and have the latest testing library installed. Does anyone know the solution to this?
The text was updated successfully, but these errors were encountered: