Created
November 3, 2017 15:01
-
-
Save aaroneaton/59133ecfe84d5e1f21462dd3e8292a0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyComponent extends React.Component { | |
... | |
render() { | |
return ( | |
<div className="parent"> | |
<div className="child" ref={el => this.targetEl = el}>Content Here</div> | |
</div> | |
) | |
} | |
... | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dropTarget = { | |
hover: (props, monitor, component) { | |
// Get the target bounding rectangle | |
const hoverBoundingRect = component.decoratedComponentInstance.contentEl.getBoundingClientRect(); | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment