Skip to content

Create utility fuctions for ref component instance extraction #97

@jspolancor

Description

@jspolancor

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')

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions