const[widgets,setWidgets]=useState([])// stores the mapping to widgetRefs, stores id and WidgetType, later used for rendering [{id: , widgetType: WidgetClass, children: [], parent: "", initialData: {}}]
// don't useState here because the refs are changing often
constwidgetRefs=useRef({})// stores the actual refs to the widgets inside the canvas {id: ref, id2, ref2...}