🏹 Draw arrows between React elements 🖋
noCurves
property for ArcherContainer
was missingpointer-events
are now set to none
as default so that you can click through the SVG containers. Thank you @viztor! https://github.com/pierpo/react-archer/pull/107
pointer-events
value in your ArcherContainer
s, you may want to put back the previous default value: <ArcherContainer
+ svgContainerStyle={{ pointerEvents: 'auto' }}
>
{/* stuff */}
</ArcherContainer>
<ArcherElement
id="root"
relations={[
{
...
style: {
strokeDasharray: "5,5",
- arrowLength: 10,
- arrowThickness: 20
+ endShape: {
+ arrow: {
+ arrowLength: 10,
+ arrowThickness: 20
+ }
}
}
}
]}
>
<div style={boxStyle}>Root</div>
</ArcherElement>;
:warning: Do not worry, you can put everything back to something strictly equivalent at what was here before.
ArcherElement
You can no longer use multiple children elements for ArcherElement
.
<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>
ArcherElement
without tweaking- const MyComponent = (props) => {
+ const MyComponent = React.forwardRef((props, ref) => {
return (
- <div>
+ <div ref={ref}>
<span>fixed</span>
</div>
);
- };
+ });
// ...
<ArcherElement><MyComponent /></ArcherElement>
Renamed to release 2.0.0.
Failed to execute 'unobserve' on 'ResizeObserver'
error (https://github.com/pierpo/react-archer/issues/84)arrowLength
not working properly when value is 0