import React, { Component } from 'react'; import { Surface, Rectangle } from 'recharts'; class RectangleDemo extends Component { state = { x: 50, y: 50, width: 80, height: 100, }; changeSize = () => { this.setState({ x: Math.random() * 50, y: Math.random() * 50, width: Math.random() * 400, height: Math.random() * 400, }); } render() { const { width, height, x, y } = this.state; return (
change size
); } } export default RectangleDemo;