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

react-vis 0.3.1 XYPlot fails on nested child array #54

Closed
ibgreen opened this issue Apr 18, 2016 · 3 comments · Fixed by #57
Closed

react-vis 0.3.1 XYPlot fails on nested child array #54

ibgreen opened this issue Apr 18, 2016 · 3 comments · Fixed by #57
Assignees
Labels
Milestone

Comments

@ibgreen
Copy link
Contributor

ibgreen commented Apr 18, 2016

Tried to upgrade from 0.1.1 to 0.3.1 but had to revert.

Got a crash in collectSeriesTypesInfo when it tried to process my application's nested array of XYPlot children.

Perhaps some higher level code is not first calling getSeriesChildren?

@ibgreen ibgreen added the bug label Apr 18, 2016
@chrisirhc
Copy link
Contributor

@ibgreen could you put an example of what you mean by nested child array? A minimum reproducible example help us track this down and ensure that we resolve the issue.

@chrisirhc chrisirhc added this to the 0.3.x milestone Apr 18, 2016
@ibgreen
Copy link
Contributor Author

ibgreen commented Apr 18, 2016

@chrisirhc In my app, props.children is an array contain a mix of react elements and arrays containing additional react elements. Conceptually something like:

  props.children = [
    LineSeries,
    LineSeries,
    [ Hint, Hint ],
];

Normally props.children is considered an opaque data type and a component should use the React.Children utilities to deal with props.children
I debugged a bit further and the problem happens when the XYPlot is constructed.

The constructor calls getStackedData which does not call React.Children utilities but tries to iterate directly on props.children

bulyonov added a commit that referenced this issue Apr 18, 2016
This fix adds the support of React.Children.toArray() into the initialization of `XYPlot` component.
This PR fixes #54.
@bulyonov
Copy link
Contributor

Fixed in #57 , waiting for the review.

ayarcohaila pushed a commit to ayarcohaila/react-vis that referenced this issue Jun 30, 2021
This fix adds the support of React.Children.toArray() into the initialization of `XYPlot` component.
This PR fixes uber#54.
ayarcohaila added a commit to ayarcohaila/react-vis that referenced this issue May 30, 2023
This fix adds the support of React.Children.toArray() into the initialization of `XYPlot` component.
This PR fixes uber#54.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants