Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Use act from 'react' #2773

Merged
merged 1 commit into from
May 6, 2024
Merged

Use act from 'react' #2773

merged 1 commit into from
May 6, 2024

Conversation

jas7457
Copy link
Contributor

@jas7457 jas7457 commented May 6, 2024

Description

In React 18.3, they have deprecated act from react-dom/test-utils and instead export it directly from react. To help with backwards compatibility, we can use it from react if the repo has >18.3.1 and fallback otherwise.

@jas7457 jas7457 requested a review from a team as a code owner May 6, 2024 15:10
@jas7457 jas7457 requested a review from emiryy May 6, 2024 15:10
@jas7457
Copy link
Contributor Author

jas7457 commented May 6, 2024

/snapit

Copy link
Contributor

github-actions bot commented May 6, 2024

🫰✨ Thanks @jas7457! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/address": "0.0.0-snapshot-20240506151112",
"@shopify/react-testing": "0.0.0-snapshot-20240506151112"

@jas7457
Copy link
Contributor Author

jas7457 commented May 6, 2024

Testing in the Discovery App:

Here are all of our tests passing with this change, using React 18.3.1:
image

Here are all of our tests passing with this change, using React 18.2.0:
image

Here is what we see when we run the code in 18.2.0:
image

Here is what we see when we run the code in 18.3.1:
image

@jas7457
Copy link
Contributor Author

jas7457 commented May 6, 2024

/snapit

Copy link
Contributor

github-actions bot commented May 6, 2024

🫰✨ Thanks @jas7457! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/address": "0.0.0-snapshot-20240506154147",
"@shopify/react-testing": "0.0.0-snapshot-20240506154147"

@jas7457 jas7457 changed the title Try to use act from 'react' Use act from 'react' May 6, 2024
@jas7457 jas7457 merged commit 7a0d348 into main May 6, 2024
9 checks passed
@jas7457 jas7457 deleted the hack-act branch May 6, 2024 16:52
@shopify-shipit shopify-shipit bot temporarily deployed to production-gem July 5, 2024 16:32 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants