You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As LayerModel doesn't inherit from DiagramModel, a class inheriting from NodeModel cannot correctly define its parent type to be a NodeLayerModel (due to the G extends NodeModelGenerics constraint), which is what the parent will actually be at runtime, if the node has been added to a layer.
The above also applies for links.
The text was updated successfully, but these errors were encountered:
The type the parent of a NodeModel must be a DiagramModel (which is a CanvasModel):
react-diagrams/packages/react-diagrams-core/src/entities/node/NodeModel.ts
Line 21 in a457385
However, when adding a node to a layer, the layer sets the node's parent to itself:
react-diagrams/packages/react-canvas-core/src/entities/layer/LayerModel.ts
Line 79 in a457385
As LayerModel doesn't inherit from DiagramModel, a class inheriting from NodeModel cannot correctly define its parent type to be a NodeLayerModel (due to the
G extends NodeModelGenerics
constraint), which is what theparent
will actually be at runtime, if the node has been added to a layer.The above also applies for links.
The text was updated successfully, but these errors were encountered: