Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
if (!this.node) {
console.error(' you should apply getRef props in the dom element') // eslint-disable-line
return
}
this.interactable = interact(this.node)
options.forEach((option) => {
if (option in this.props) {
this.interactable[option](this.props[option])
}
})
events.forEach((event) => {
const handler = this.props[`on${event}`]
if (typeof handler === 'function') {
this.interactable
.on(event.toLowerCase(), handler)
}
})
}
componentWillUnmount() {