Raphael.FreeTransform
Raphael.FreeTransform copied to clipboard
How to use this in reactJs project in componentDidMount(){} methode?
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
.
@AnurajRicky @beasteers Did this worked ? like importing like that "import 'Raphael.FreeTransform';".
Thanks, do let me know.