TypeError: Cannot read property 'current' of undefined. In React v18
RonaldCast opened this issue · 1 comments
RonaldCast commented
react-hooks-testing-libraryversion:^8.0.0"reactversion: ^18.1.0react-domversion (if applicable): ^18.1.0"nodeversion: 14.17.4npm(oryarn) version: 6.14.14
Problem description:
I have this error in React v18.1.0, but in React v17.0.2 work good.
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)
})
})
joshuaellis commented
This library does not and will not support react 18. See #831 (comment) for more information.
