question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support @cypress/react18

See original GitHub issue

Description

The Cypress team recently published their @cypress/react18 component. We should update @nrwl/react generators to support this new feature. We would need to add conditional logic to our generators to ensure that any updates are backward compatible with React v17

Motivation

The ReactDom.render method is no longer supported in React v18, which is bundled with the old mount() command in @cypress/react @cypress:react - v18 Warning

Suggested Implementation

Alternate Implementations

  • Additional changes may be required within @nrwl/cypress:cypress-component-project generator

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
barbados-clemenscommented, Sep 14, 2022

Just noticed this today so thanks for making the issue! Should be able to get to it this week unless you’d like to do it @tyler-morrison. Your implementation is correct just need to check for the react version in the repo and use the dep version required for the generators.

0reactions
barbados-clemenscommented, Sep 22, 2022

I think you’re right, though technically someone can down level their packages and still run v17. But in that case, we should only generate v18 react code and if people still want to use v17 then they can change the import back to cypress/react instead of cypress/react18

so in this case should check for v17 react versions on in the migration and skip the migration if people are still on v17 and just generate new stuff with v18 support.

Let me know if you need any help or have more questions 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress Testing fails to build on React version 18 #21381
The plan is to support React 18 very soon once this lands: #22437 which from what I can see only has 1 legitimate...
Read more >
@cypress/react - npm
Test React components using Cypress. Latest version: 7.0.2, last published: 22 days ago. Start using @cypress/react in your project by ...
Read more >
React Quickstart - Cypress Documentation
Welcome! This tutorial will walk you through creating a React app and using Cypress Component Testing to test it. We assume you are...
Read more >
Testing React Apps In 2022 With Cypress: An In-Depth Guide ...
And this doesn't support the Cypress commands like contains() . ... 18-react-cypress-prepare-fixture-or-mock-data.
Read more >
Cypress 10.4 is live! Cypress Component... | Facebook
✓ Cypress Component testing now supports React 18 via the cypress/react18 package. ✓ Cypress Component testing now supports Vite 3. Check out the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found