testing-library / testing-library/react-testing-library
renderHook Server
Open
Nobody has claimed this yet.
question
- Dominant language
- JavaScript
- Stars
- 19.7k
- Forks
- 1.2k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 1
Description
What is your question:
How can I migrate this code from @testing-library/react-hooks to @testing-library/react to use react18 and use the ssr environment?
old code
import { renderHook as renderHookSSR } from '@testing-library/react-hooks/server';
it('should ', () => {
const { result, hydrate } = renderHookSSR(() => true);
expect(result).toBe(true);
hydrate();
expect(result.current).toBe(true);
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided @testing-library/react-hooks/server example and review the React 18 SSR usage requested for @testing-library/react. Confirm how renderHook, result assertions, and hydrate should be represented; done means a clear migration example covering the shown test behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, typescript
- Domain
- frontend, testing-qa
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100