Closed
Description
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?
import { renderHook } from "@testing-library/react-hooks";
test("should autoconnect", async () => {
const { result, waitForNextUpdate } = renderHook(() => useConnectionService(ethereumProviders, storageService));
await waitForNextUpdate();
expect(result.current[0].account).not.toBeNull();
});
Results in 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