Skip to content

Commit

Permalink
fix(core): children can be undefined or null
Browse files Browse the repository at this point in the history
Checking for null children for the chart.
  • Loading branch information
markmcdowell committed Aug 27, 2020
1 parent 00a5cbe commit 17aa844
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/utils/ChartDataUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const isChartProps = (props: ChartProps | any | undefined): props is ChartProps

export function getNewChartConfig(innerDimension: any, children: any, existingChartConfig: any[] = []) {
return React.Children.map(children, (each) => {
if (each !== undefined && isChartProps(each.props)) {
if (each !== undefined && each !== null && isChartProps(each.props)) {
const chartProps = {
...Chart.defaultProps,
...each.props,
Expand Down
2 changes: 1 addition & 1 deletion packages/stories/src/features/axis/Axis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class AxisExample extends React.Component<ChartProps> {
xExtents={xExtents}
>
<Chart id={1} yExtents={this.yExtents}>
<CandlestickSeries />
<XAxis />
<YAxis axisAt={axisAt} {...rest} />
<CandlestickSeries />
</Chart>
</ChartCanvas>
);
Expand Down

0 comments on commit 17aa844

Please sign in to comment.