Open MozilaIP opened 5 years ago
Check how the onToggle handler is passed in the readme example:
In App component
childProps = { onToggle: this.onToggle };
In App render / ZoomableSvg element props
childProps={this.childProps}
In SvgRoot onPress event handler:
const { onToggle } = this.props;
if (onToggle) {
onToggle();
}
Hi, In my app I need to pass some variable data to be drawn.
Example:
<Ellipse cy={this.state.y} cx={this.state.x} />
But I am unable to do this since svgRoot does not inherit properties from parent component. Moreover, I want svgRoot to execute render on state change, but, as written above, I can't pass any state to it, hence this component is not reactive.
Is there any workaround for my issue?