Skip to content

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