I am trying to run the example code from the docs, but nothing shows. I get the following errors in the console:
root ERROR Warning: Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.%s
Check the render method of
Component.
in Component (created by Component)
in Component (created by MyView)
in MyView
and
root ERROR The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".
here is my code:
export namespace MyView {
export interface Props {
}
export interface State {
}
}
export class MyView extends React.Component<MyView.Props, MyView.State> {
protected readonly engine: DiagramEngine;
protected readonly model: DiagramModel;
constructor(props: MyView.Props) {
super(props);
this.engine = createEngine();
const node1 = new DefaultNodeModel({
name: 'Node 1',
color: 'rgb(0,192,255)'
});
node1.setPosition(100,100);
let port1 = node1.addOutPort('Out');
// node 2
const node2 = new DefaultNodeModel({
name: 'Node 2',
color: 'rgb(0,150,255)',
});
node2.setPosition(50, 100);
let port2 = node2.addOutPort('Out');
const link = port1.link<DefaultLinkModel>(port2);
link.addLabel('Hello World');
this.model = new DiagramModel();
this.model.addAll(node1, node2, link);
this.engine.setModel(this.model);
}
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | string | number | {} | React.ReactNodeArray | React.ReactPortal | boolean | null | undefined {
return <CanvasWidget engine={this.engine} />
}
}
Any ideas?
Been getting this too when creating a blank react-create-app
The 'unique key' warning can be traced to here. https://github.com/projectstorm/react-diagrams/blob/326567c290a37a4e60c0be5a0bfa12a267c3b643/packages/react-canvas-core/src/entities/canvas/CanvasWidget.tsx#L96
can confirm just started integrating and getting these two errors as well.

any incoming fix for this? does @David-Melo 's fix work?
Fix for unique key error: https://github.com/projectstorm/react-diagrams/pull/425
Most helpful comment
can confirm just started integrating and getting these two errors as well.
