嘿,我是新来的反应康瓦。我正在创建一个项目,我希望一个矩形围绕一个对象旋转。任何人都可以告诉我如何实现这一目标。任何帮助深表感谢
<div>
<Stage width={500} height={500}>
<Layer>
<Rect ///<=this rect is the center object
width={50}
height={100}
x={20}
y={20}
strokeWidth={2}
stroke="red"
fill="blue"
opacity={1}
/>
<Rect ///<=this rect should revolve around it
width={50}
height={100}
x={50}
y={50}
strokeWidth={2}
stroke="black"
fill="black"
opacity={1}
/>
</Layer>
</Stage>
<Button onClick={handleRotate}>Start Rotation</Button>
</div>