React Archer Versions Save

🏹 Draw arrows between React elements 🖋

v3.2.2

2 years ago

Fixes

v3.2.1

2 years ago

Fixes

  • Add missing typescript definition: noCurves property for ArcherContainer was missing

v3.2.0

3 years ago

Features

v3.1.0

3 years ago

Features

image

v3.0.0

3 years ago

New features

Breaking changes

  • If you've been using the default pointer-events value in your ArcherContainers, you may want to put back the previous default value:
 <ArcherContainer
+   svgContainerStyle={{ pointerEvents: 'auto' }}
 >
   {/* stuff */}
 </ArcherContainer>
  • The arrow end styling API has changed. You should update them to fit the new API :blush:
 <ArcherElement
   id="root"
   relations={[
     {
       ...
       style: {
         strokeDasharray: "5,5",
-        arrowLength: 10,
-        arrowThickness: 20
+        endShape: {
+          arrow: {
+            arrowLength: 10,
+            arrowThickness: 20
+          }
         }
       }
     }
   ]}
>
  <div style={boxStyle}>Root</div>
</ArcherElement>;

v2.0.2

3 years ago

Bugfixes/features

v2.0.1

4 years ago

Typescript

  • Updated types

v2.0.0

4 years ago

Breaking changes

:warning: Do not worry, you can put everything back to something strictly equivalent at what was here before.

No more multiple children to ArcherElement

You can no longer use multiple children elements for ArcherElement.

  • If you really need multiple children, then you need to wrap them in a <div />. It used to be done like this internally but this was causing drawing issues, so now to achieve the same as before you should now wrap your elements yourself.

If your layout broke, try the following. We used to add an artificial div internally with ArcherElement, which has been removed. A quick fix is to add back the div yourself:

<ArcherElement>
-  <Content />
+  <div>
+    <Content />
+  </div>
</ArcherElement>

No more custom components as direct children of ArcherElement without tweaking

  • You can no longer use custom components as a direct child of ArcherElement out of the box. Two fixes possible:
    • wrap it in a div, as mentioned above. Ok if it doesn't break your layout.
    • forward the reference of your component to the DOM element in your component that will act as a drawing reference. See below:
- const MyComponent = (props) => {
+ const MyComponent = React.forwardRef((props, ref) => {
   return (
-    <div>
+    <div ref={ref}>
       <span>fixed</span>
     </div>
   );
- };
+ });

// ...

<ArcherElement><MyComponent /></ArcherElement>

Bugfixes

  • Solved an issue with arrows not drawing to the proper element #93
    • This was probably the root of many problems. If you had problems with arrows not drawing properly, try this new release :wink:

v.1.6.0

4 years ago

Renamed to release 2.0.0.

v1.5.1

4 years ago

Bugfixes