-
Notifications
You must be signed in to change notification settings - Fork 148
Pass ref to rendered element #48
Copy link
Copy link
Closed
Description
I require access to the rendered element to determine it's width.
Attaching a ref to <Swipable> gives access to the component but not the underlying DOM node.
I can access the node via: this.refs.swipable._reactInternalInstance._renderedComponent._hostNode.
or
ReactDOM.findDOMNode(this.refs.swipable)
My problem can be solved if Swipable attaches it's own ref attribute. e..g
var newProps = _extends({}, this.props, {
ref="elem"
onTouchStart: this.touchStart,
onTouchMove: this.touchMove,
onTouchEnd: this.touchEnd
});Can now be accessed via: this.refs.swipable.refs.elem.
Thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels