React duplicate key error in DefaultLinkSegmentWidget

Author: sdurhamCreated Jul 20, 2025Updated Jul 20, 2025

I'm not sure the correct fix, but this worked for me in:

/node_modules/@projectstorm/react-diagrams-defaults/dist/link/DefaultLinkSegmentWidget.js

const key = `${Bottom.key}-top`; // Give the duplicated item a unique key
const Top = React.cloneElement(Bottom, Object.assign({ key }, ... rest of current code

Source: projectstorm/react-diagrams