Skip to content

renderHook() results in: Warning: ReactDOM.render is no longer supported in React 18. #826

Closed
@alxlacayo

Description

@alxlacayo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions