Open AnurajRicky opened 6 years ago
Something like this should work:
import React from "react"; import { Paper, Set, Rect } from 'react-raphael'; import 'Raphael.FreeTransform'; class Rectangle extends React.Component { onLoad = (element) => { this.transformer = element.paper.freeTransform(element); } componentWillUnmount() { this.transformer.unplug(); } render() { return <Rect load={this.onLoad} />; } } ...
You need to use the react-raphael load callback to access the element because it may not be loaded at the time of componentDidMount.
load
componentDidMount
@AnurajRicky @beasteers Did this worked ? like importing like that "import 'Raphael.FreeTransform';".
Thanks, do let me know.
Something like this should work:
You need to use the react-raphael
load
callback to access the element because it may not be loaded at the time ofcomponentDidMount
.