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

Idea/export use chart context #295

Open
wants to merge 2 commits into
base: beta
Choose a base branch
from

Conversation

RichardNolan
Copy link
Contributor

I made this suggestion in the ideas discussion - #294
This simply exports the useChartContext hook. I also changed the hook to throw an error if it is not within the provider. Finally, I had to set the type of the exported ctx using an "as".

I thought this was an easier solution than passing the context as an argument to the renderSVG function (renderSVG: (props)=> <SomeComponent {...props} /> or renderSVG: (ctx)=> )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant