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

Create utility fuctions for ref component instance extraction #97

Open
jspolancor opened this issue Mar 3, 2023 · 0 comments
Open

Create utility fuctions for ref component instance extraction #97

jspolancor opened this issue Mar 3, 2023 · 0 comments
Assignees

Comments

@jspolancor
Copy link
Contributor

At the moment the only way to extract the component instance of a ref is using a deeply nested chain of object properties:

const refInstance = GrandParentComponent.__instance.refs.child.component.__instance;

This can become quite cumbersome when trying to get a nested ref

const nestedRefInstance = GrandParentComponent.__instance.refs.parent.component.__instance.refs.child.component.__instance;

It would be amazing to have an utility function for instance extraction

const refInstance = GrandParentComponent.getRefInstance('child');
const nestedRefInstance = GrandParentComponent.getRefInstance('parent').getRefInstance('child')
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

No branches or pull requests

1 participant