Reproduction link

Steps to reproduce
Open the codesanbox attached.
The problem seems to be when the component status changes and the chart needs to refresh.
If the re-render is disabled than the legend is positioned correctly.
useEffect(() => {
setTest("");
}, []);
What is expected?
Legend position should be correct
What is actually happening?
Legend overlapping with chart when re-rendering
| Environment |
Info |
| Recharts |
v2.1.6 |
| React |
reactjs 17 |
| System |
all |
| Browser |
all |
seems to be similar to issue #2636
But I'm using rechart 2.1.6 and the issue is still there
Reproduction link
Steps to reproduce
Open the codesanbox attached.
The problem seems to be when the component status changes and the chart needs to refresh.
If the re-render is disabled than the legend is positioned correctly.
What is expected?
Legend position should be correct
What is actually happening?
Legend overlapping with chart when re-rendering
seems to be similar to issue #2636
But I'm using rechart 2.1.6 and the issue is still there