-
Notifications
You must be signed in to change notification settings - Fork 217
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
Can't put a chart in an external component #417
Comments
Hi there, hopefully I'm understanding you correct. The You should be able to just wrap the
|
Correct. But it cannot be like this:
Where
|
Aha yes I seem what you mean, it's definitely related to the legacy context api (which I need to remove). My first guess would be if it was a class component it may work. I'm not too familiar with how the legacy one works, hard to find docs on it. |
I tried with a class component but I got the same error. How long will it take to migrate to the new context api? is it something we can expect in the next pre-release? |
The intention is that v1 will be using the new context api, which is in the next couple of weeks. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I also faced this issue. This is because of the @mattiaz9 As a workaround you can organize your custom component to return a
Usage:
|
Checking props for id to allow external components as mentioned in react-financial#417.
Checking props for id to allow external components as mentioned in #417.
Closing as this is fixed in the latest alpha versions, the custom component needs to have at least an id prop. |
I'm submitting a...
What is the current behavior
When I try to put a Chart in an external component I get this error:
TypeError: Cannot destructure property 'origin' of 'this.context.chartConfig.find(...)' as it is undefined
Looks like a Chart must be a direct descendant of the ChartCanvas component.
What is the expected behavior
We should be able to organize the code using external components as it could get pretty messy.
Please tell us about your environment
Other information
Could this be related to the old context api?
The text was updated successfully, but these errors were encountered: