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

Unable to get the advanced configuration passProps to work #186

Open wip-abramson opened 1 year ago

wip-abramson commented 1 year ago

I am attempting to change the color of the arrow onHover. Figured I would use the passProps feature as follows:

passProps= {{
                onMouseEnter: () => setIsHovered(true),
                onMouseLeave :() => setIsHovered(false),
                onClick: () => console.log("head clicked!"),
                cursor: "pointer",
                pointerEvents: "auto"
            }}

However, none of these props take effect on the arrow.

To Reproduce

  1. Define an Xarrow react element with valid start and end references to components
  2. Set passProps value as above
  3. Attempt to hover or click on the Xarrow

Has anyone else had any success using this feature?

TracyYXChen commented 11 months ago

all props above work for me, however, I can't change the color based on isHovered