Open JohnFoster44 opened 3 weeks ago
Found the solution: if the generated id is not working out for you, you can set a custom one.
https://commerce.nearform.com/open-source/victory/docs/api/victory-clip-container#clipid
import { VictoryChart, VictoryLine, VictoryClipContainer } from "victory";
<VictoryChart width={640} maxDomain={{ y: 200 }}>
<VictoryLine
style={{data: { stroke: "#198c53" }}}
data={data}
interpolation={"natural"}
groupComponent={<VictoryClipContainer clipId={"custom-id"} />}
/>
</VictoryChart>
Fixable but would be great if its looked into!
I'm looking into this now...
The best fix is to use React 18+'s useId()
instead of Lodash's uniqueId()
for generating clipId
. It works great. Unfortunately, this would break compatibility with React 16, which Victory supports.
Very recently there have been other PRs that revert useId
to maintain backwards compatibility. https://github.com/FormidableLabs/victory/pull/2916
Is there an existing issue for this?
Code of Conduct
Victory version
^37.3.0
Code Sandbox link
No response
Bug report
Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
Environment