React 18 useId() conflict with jQuery #27922
Labels
CT
Issue related to component testing
npm: @cypress/react18
@cypress/react18 package issues
stale
no activity on this issue for a long period
Current behavior
When trying to interact with an element rendered by React that has
htmlFor
set to an ID returned by theuseId()
hook, the peculiar syntax React uses for IDs in React 18 actually causes an error:Note the
:r0:
portion (I know it says react-aria but under the hood it's using R18'suseId
API).We don't want to escape
htmlFor
because that breaks platform functionality, jQuery should just handle/ignore it.Interestingly the selector used in Cypress didn't even target that attribute:
Desired behavior
No response
Test code to reproduce
Example React code:
Then example Cypress test code:
Cypress Version
12.17.4
Node version
20
Operating System
macOS latest
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: