Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

Idea/export use chart context - #295

Open
RichardNolan wants to merge 2 commits into
TanStack:betafrom
RichardNolan:idea/export-useChartContext
Open

Idea/export use chart context#295
RichardNolan wants to merge 2 commits into
TanStack:betafrom
RichardNolan:idea/export-useChartContext

Conversation

@RichardNolan

Copy link
Copy Markdown
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)=> )

注册 for free to subscribe to this conversation on GitHub. Already have an account? 登录.

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant