Skip to content

Warning: Cannot update a component (TestComponent) while rendering a different component (TestComponent). #1895

Closed Answered by dbritto-dev
budarin asked this question in Bug report
Discussion options

You must be logged in to vote

the problem was in using wrong library
testing-library/react-hooks-testing-library#826 (comment)

it is necessary to use
import { renderHook } from '@testing-library/react';
instead of
import { renderHook } from '@testing-library/react-hooks';

@budarin yes, from react 18 you need to use renderHook from @testing-library/react

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@budarin
Comment options

@budarin
Comment options

@dbritto-dev
Comment options

Answer selected by dbritto-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants