Closed cjesper closed 2 years ago
Very strange, what you used for production build? Create react app?
Yes, create-react-app and then npm run build. I've tested with yarn build as well, same issue.
Update: I upgraded all of my libraries (most importantly react from 16 to 17) and that fixed the strange issue.
interesting. let me know if you realize more
Describe the bug & Expected behavior First of all, thanks for a great library. When i use react-xarrows in my app it works perfectly locally, but if it's run with npm run build/serve it suddenly stops working. Background: I am creating an app where users can drag and drop various components. I use xarrows to draw connections between elements. I am using react-draggable for the drag and drop functionality. To achieve this behaviour, i am using the onDrag-property of the react-draggable.
To Reproduce:
My components look like this:
And then
In the parent component:
Components are the Draggable components. Connectors are the xarrow-connectors. They have the form
And then the Connector-component (some fluff-code like labels etc left out for brevity:
More background info: Because i want the views to be persistent i save the coordinates of the elements in a database. I also save the start- and end positions for the connectors (xarrows) Then, when the view is rendered (on mount) i fetch the coordinates and populate the view with the components:
And the connectors:
Screenshots I recorded a short screen capture of the issue. The first part displays how the app works in local development (npm start), and then i switch over to using a locally built version (npm run build) where the arrows no longer update their position. https://streamable.com/kdj3w5