Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use forward refs instead of containerRef for references to the rendered chart #2678

Open
2 tasks done
wushenrong opened this issue Nov 24, 2023 · 2 comments
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

Comments

@wushenrong
Copy link

wushenrong commented Nov 24, 2023

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 uses useRef() 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.

@wushenrong
Copy link
Author

Reproduction of problem here: https://github.com/TwoPizza9621536/victory-ref-reproduce

@carbonrobot carbonrobot added Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release Status: Help Wanted 🔨 Extra attention is needed labels Jan 16, 2024
@carbonrobot
Copy link
Contributor

Blocked by #2799

@carbonrobot carbonrobot added the Issue: Accepted The submitted issue has been confirmed by the Victory core team label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants