diff --git a/src/Hammer.js b/src/Hammer.js index 22ea632..850eb69 100644 --- a/src/Hammer.js +++ b/src/Hammer.js @@ -137,8 +137,11 @@ export default class HammerComponent extends React.Component { }, this); var self = this; - props.ref = function(domElement) { - if (self.props.ref) { + props.ref = function (domElement) { + if (self.props.children && self.props.children.ref) { + // If the child has the ref set, call the child's ref method + self.props.children.ref(domElement); + } else if (self.props.ref) { self.props.ref(domElement); } self.domElement = domElement;