Skip to content
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

fix: Stop restricting container option based on hydrate #1313

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Apr 24, 2024

Closes #1312
Closes #1311

It's really not worth it to have such extensive types just to restrict container properly. Especially because it makes composing render and renderHook so hard. And we do want to encourage wrapping render in your tests.

Copy link

codesandbox-ci bot commented Apr 24, 2024

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 f5f9f9e:

Sandbox Source
react-testing-library-examples Configuration

@@ -1,4 +1,7 @@
{
"extends": "../node_modules/kcd-scripts/shared-tsconfig.json",
"compilerOptions": {
"skipLibCheck": false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never actually typechecked the .d.ts files before.

@@ -179,19 +171,15 @@ export interface RenderHookResult<Result, Props> {
unmount: () => void
}

export interface BaseRenderHookOptions<
/** @deprecated */
export type BaseRenderHookOptions<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so I'll understand, what's the motivation with changing this one from an interface to a type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just an alias for RenderHookOptions whereas an interface would create a new type.

@eps1lon eps1lon changed the title Stop restricting container option based on hydrate fix: Stop restricting container option based on hydrate Apr 26, 2024
@eps1lon eps1lon merged commit d143f46 into testing-library:main Apr 26, 2024
10 checks passed
@eps1lon eps1lon deleted the simple-container branch April 26, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants