Skip to content

fix(TS): add hydrate typings #250

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

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

RoystonS
Copy link
Contributor

What:

Add typings for new hydrate render option

Why:

Enables the new API to be used from TypeScript

How:

Pulled existing options into a new RenderOptions interface for clarity + reuse and added new member to that.

Checklist:

  • Documentation N/A
  • Tests N/A
  • Ready to be merged - possibly not: see note below
  • Added myself to contributors table

Note

The current TS definition of container has it as a mandatory property (in the optional options object). This means that it's not possible to write render(ui, { hydrate: true }). Users would have to write render(ui, { container: someNewContainerTheyveMade, hydrate: true }). This seems wrong. Should container just be optional?

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Cool 👍

@kentcdodds kentcdodds merged commit f099d2f into testing-library:master Dec 19, 2018
@kentcdodds
Copy link
Member

🎉 This PR is included in version 5.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

lucbpz pushed a commit to lucbpz/react-testing-library that referenced this pull request Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants