Use forward refs instead of containerRef
for references to the rendered chart
#2678
Open
2 tasks done
Labels
Issue: Accepted
The submitted issue has been confirmed by the Victory core team
Status: Help Wanted 🔨
Extra attention is needed
Type: Enhancement ✏️
An enhancement or feature proposal that will be addressed after the next release
Feature Requests
Checklist
I've read through the Docs and Guides to make sure this functionality doesn't already exist
I've searched open issues to make sure I'm not opening a duplicate issue
Description
#781 implemented a way to get the reference of charts using the
containerRef
prop on<VictoryContainer>
to export charts, but this only works with older react class components as the newer function components usesuseRef()
to get the reference of components. This implementation also reads ref by assigning the ref during rendering which is not recommended and does not get the entire chart. #1917 and #2673 have forward refs but not for containers or charts.Edit: #781 uses
useLayoutEffect
as one of the ways to migrate this issue but this should not be required as the chart only needs to be rendered once for the full chart to appear.The text was updated successfully, but these errors were encountered: