Skip to content

fix(render): Actually hydrate with given ui #988

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 3 commits into from
Oct 31, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Oct 28, 2021

What:

Fix "missing act" warnings when calling render(ui, {container, hydrate}) using react@alpha.

Why:

Previous hydrateRoot usage was just wrong (see facebook/react#22643 for more information).

How:

Call hydrateRoot with the given ui and wrapped in act

Checklist:

  • [ ] Documentation added to the
    docs site
  • Tests
  • [ ] TypeScript definitions updated
  • Ready to be merged

@eps1lon eps1lon added the bug Something isn't working label Oct 28, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 28, 2021

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

Sandbox Source
React Configuration
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Oct 28, 2021

Codecov Report

Merging #988 (c113333) into alpha (68d2a23) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             alpha      #988   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          224       226    +2     
  Branches        46        46           
=========================================
+ Hits           224       226    +2     
Flag Coverage Δ
experimental 94.24% <100.00%> (+0.05%) ⬆️
latest 90.26% <20.00%> (-0.81%) ⬇️
next 94.24% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pure.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68d2a23...c113333. Read the comment docs.

@eps1lon eps1lon marked this pull request as ready for review October 28, 2021 16:07
@eps1lon eps1lon merged commit d8c6b4d into testing-library:alpha Oct 31, 2021
@eps1lon eps1lon deleted the fix/hydrate branch October 31, 2021 08:52
@github-actions
Copy link

🎉 This PR is included in version 13.0.0-alpha.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

eps1lon added a commit to eps1lon/react-testing-library that referenced this pull request Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @alpha
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant