Eliav2 / react-xarrows

Draw arrows (or lines) between components in React!
https://codesandbox.io/embed/github/Eliav2/react-xarrows/tree/master/examples?fontsize=14&hidenavigation=1&theme=dark
MIT License
584 stars 75 forks source link

Warnings that attribute "repeatCount" has unexpected value of "0" #160

Closed DavidErben closed 1 year ago

DavidErben commented 1 year ago

Describe the bug & Expected behavior

React Dev Tools show warnings that the attribute "repeatCount" has an unexpected value of 0.

grafik

Setup:

    <Xarrow
      start={startElement}
      end={endElement}
      startAnchor={"right"}
      endAnchor={"left"}
      color={theme.palette.primary.main}
      curveness={0.5}
      showHead={true}
      animateDrawing={1}
      dashness={{ strokeLen: 10, nonStrokeLen: 10, animation: 1 }}
    />

According to Mozilla docs the value of the attribute must be either a value greater than 0 or "indefinite":

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/repeatCount

HTML:

grafik

Source code in XArrow.tsx:

grafik

To Reproduce

Use setup above, but it should be easy to reproduce.

Version used: 2.0.2

Eliav2 commented 1 year ago

this is not specific to react-xarrows

DavidErben commented 1 year ago

Could you please explain why this is not specific to "react-xarrows"? Isn't this warning coming from the code in the screenshot below?

If I use "showHead={false}", the warning goes away because the selected code is not rendered anymore. Wouldn't a valid value for "repeatCount" (f.e. "1" or "indefinite") in the heads element solve this? Or is there another way to fix this? Unfortunately there are no props which are passed down to this element, only for the head itself.

grafik