feat: add support for multiple arguments in renderHook() by danielrentz · Pull Request #1403 · testing-library/react-testing-library · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

feat: add support for multiple arguments in renderHook() #1403

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielrentz
Copy link

@danielrentz danielrentz commented Jun 20, 2025

What:

Add support for multiple arguments for function renderHook. Fixes #1350.

Why:

Hooks can take multiple arguments. The current implementation assumes a single argument (derived from render taking a single "props" for rendering components).

How:

Change renderHook to take a new array option "initialArgs". Option "initialProps" remains in place for backward compat. The options are mutually exclusive.
The "rerender" function returned from "renderHooks" accepts multiple arguments as well.

Checklist:

Comments:

This is a redo of PR #1386 which lacks correct TS typings, tests for TS typings, documentation update, and seems to be abandoned.

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b5f7249:

Sandbox Source
react-testing-library-examples Configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

renderHook support for multiple parameters
1 participant

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.