Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Conversation

@eavichay
Copy link

Currently there is no direct access to the native custom element, even via refs.
The API exposes a way to reach the element itself to retrieve values, attributes, etc.

eavichay added 2 commits May 30, 2018 01:21
Use case: Accessing properties or attributes directly from the element.
Problem: Impossible to access, event via refs, as it reaches the wrapper class only.
@stevemao
Copy link
Member

What's the use-case of this one?

return this._elementNode;
}
componentDidMount() {
this._elementNode = ReactDOM.findDOMNode(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same thing as what was happening before?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this change it is exposed. The scoped node element is not accessible outside the funciton before this change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@treshugart Can this be merged? This helps accessing the native element directly

Copy link
Contributor

@treshugart treshugart Aug 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess what I was wondering is that, if you can call comp.getNativeElement(), then you can call findDOMNode(comp) just as easily, no?

@eavichay
Copy link
Author

eavichay commented Aug 5, 2018

ping?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants