Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Example of how to get the reference to a component in v4 #283

Closed
bizmonogatari opened this issue Jun 12, 2020 · 1 comment
Closed

Example of how to get the reference to a component in v4 #283

bizmonogatari opened this issue Jun 12, 2020 · 1 comment
Assignees
Labels
bug difficulty: easy 🚴 Probably an easy change released topic: first impression ⁉️ Issues that affect first-time users

Comments

@bizmonogatari
Copy link

  1. I would like to have an example of how I can get a reference to a component please. Can anyone help?

mount(<App sdk={sdk} />)
cy.get('@App').then(x => console.log(x)) // null

  1. It looks like the examples in index.ts are outadated.
 import Hello from './hello.jsx' 
 // mount and access by alias 
 cy.mount(<Hello />, 'Hello') 
 // using default alias 
 cy.get('@Component') 
 // using original component 
 cy.get(Hello) 

When I try and pass a string as the second argument of mount I get a type error

@bahmutov bahmutov added the bug label Jun 12, 2020
@bahmutov bahmutov self-assigned this Jun 12, 2020
@bahmutov bahmutov added difficulty: easy 🚴 Probably an easy change topic: first impression ⁉️ Issues that affect first-time users labels Jun 12, 2020
@bahmutov
Copy link
Contributor

🎉 This issue has been resolved in version 4.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug difficulty: easy 🚴 Probably an easy change released topic: first impression ⁉️ Issues that affect first-time users
Projects
None yet
Development

No branches or pull requests

2 participants