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

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
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.

None yet

3 participants