Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderReactComponent() {
const bounds = this.bounds.clone()
let transform = `translate(${bounds.x},${bounds.y})`
const deg = this.getShapeRotation()
if (deg !== 0) {
transform += ` rotate(${deg},${bounds.width / 2},${bounds.height / 2})`
}
const g = util.createSvgElement('g')
g.setAttribute('transform', transform)
const fo = util.createSvgElement('foreignObject')
util.setAttributes(fo, { width: bounds.width, height: bounds.height })
const div = util.createElement('div')
div.style.width = util.toPx(bounds.width)
div.style.height = util.toPx(bounds.height)
div.style.overflow = 'hidden'
g.appendChild(fo)
fo.appendChild(div)
if (this.container == null) {
this.container = util.createElement('div')
if (this.component != null) {
renderReactComponent() {
const bounds = this.bounds.clone()
let transform = `translate(${bounds.x},${bounds.y})`
const deg = this.getShapeRotation()
if (deg !== 0) {
transform += ` rotate(${deg},${bounds.width / 2},${bounds.height / 2})`
}
const g = util.createSvgElement('g')
g.setAttribute('transform', transform)
const fo = util.createSvgElement('foreignObject')
util.setAttributes(fo, { width: bounds.width, height: bounds.height })
const div = util.createElement('div')
div.style.width = util.toPx(bounds.width)
div.style.height = util.toPx(bounds.height)
div.style.overflow = 'hidden'
g.appendChild(fo)
fo.appendChild(div)
if (this.container == null) {
this.container = util.createElement('div')
if (this.component != null) {
ReactDOM.render(this.component, this.container)
}
}