Skip to content
Source
Sign inSign up
TanStack/react-charts

Idea/export use chart context #295

OpenRichardNolan(GitHub profile, opens in a new tab)wants to merge 2 commits intobeta fromrefs/pull/295/headopened

I made this suggestion in the ideas discussion - https://github.com/TanStack/react-charts/discussions/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)=> )

  1. Nothing happened in this round.

Sign in to join this conversation.