Skip to content

TypeError: Cannot read property 'current' of undefined. In React v18 #842

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

Closed
RonaldCast opened this issue May 19, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@RonaldCast
Copy link

  • react-hooks-testing-library version:^8.0.0"
  • react version: ^18.1.0
  • react-dom version (if applicable): ^18.1.0"
  • node version: 14.17.4
  • npm (or yarn) version: 6.14.14

Problem description:

I have this error in React v18.1.0, but in React v17.0.2 work good.

image

Code

This is my code that throws the error.

import { renderHook } from "@testing-library/react-hooks"
import useCounter from "../../hooks/useCounter"

describe("xxxxxxxxxxxxxxx", () => {

    test("xxxxxxxxxxxxxxxxxx", () =>{
        const r = renderHook(() => useCounter())

        console.log(r)
    })
})
@RonaldCast RonaldCast added the bug Something isn't working label May 19, 2022
@joshuaellis
Copy link
Member

This library does not and will not support react 18. See #831 (comment) for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants