Skip to content

Commit

Permalink
Replace Hidden with React.Fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
anajavi committed Sep 27, 2019
1 parent 6d8191e commit 9d6664c
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 25 deletions.
5 changes: 1 addition & 4 deletions packages/react-jsx-highcharts/src/components/Debug/Debug.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import Hidden from '../Hidden';
import useChart from '../UseChart';

const Debug = ({ varName = 'chart' }) => {
Expand All @@ -13,9 +12,7 @@ const Debug = ({ varName = 'chart' }) => {
return () => window[varName] = undefined;
}, [varName]);

return (
<Hidden />
);
return null;
}

Debug.propTypes = {
Expand Down
7 changes: 0 additions & 7 deletions packages/react-jsx-highcharts/src/components/Hidden/Hidden.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/react-jsx-highcharts/src/components/Hidden/index.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import HighchartsChart from '../HighchartsChart';
import Chart from '../Chart';
import XAxis from '../XAxis';
import YAxis from '../YAxis';
import Hidden from '../Hidden';

const defaultSparklinePlotOptions = {
series: {
Expand Down Expand Up @@ -81,7 +80,7 @@ const HighchartsSparkline = ({
{Series}
</YAxis>

{hasSeriesProp && <Hidden>{children}</Hidden>}
{hasSeriesProp && <>{children}</>}
</HighchartsChart>
);
};
Expand Down
1 change: 0 additions & 1 deletion packages/react-jsx-highcharts/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export { default as withHighcharts } from './components/WithHighcharts';
export { default as Axis } from './components/Axis';
export { default as BaseChart } from './components/BaseChart';
export { default as Debug } from './components/Debug';
export { default as Hidden } from './components/Hidden';
export { default as Series } from './components/Series';

// Utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { attempt } from 'lodash-es';
import {
Hidden,
useModifiedProps,
useChart,
useHighcharts
Expand Down Expand Up @@ -40,7 +39,7 @@ const MapNavigation = ({ children, enabled = true, ...restProps}) => {

if (!children || !rendered) return null;

return <Hidden>{children}</Hidden>;
return <>{children}</>;
};
const getMapNavigationConfig = (props, Highcharts) => {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, Children, cloneElement, isValidElement } from 'react';
import PropTypes from 'prop-types';
import { Hidden, useAxis, useModifiedProps, getNonEventHandlerProps } from 'react-jsx-highcharts';
import { useAxis, useModifiedProps, getNonEventHandlerProps } from 'react-jsx-highcharts';

const NavigatorAxis = props => {
const axis = useAxis();
Expand Down Expand Up @@ -32,9 +32,9 @@ const NavigatorAxis = props => {
});

return (
<Hidden>
<>
{axisChildren}
</Hidden>
</>
);
}
const updateNavigatorAxis = (config, axis) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { attempt } from 'lodash-es';
import { Hidden, useHighcharts, useAxis, useChart, useModifiedProps } from 'react-jsx-highcharts';
import { useHighcharts, useAxis, useChart, useModifiedProps } from 'react-jsx-highcharts';

const RangeSelectorInner = ({ enabled = true, ...restProps }) => {
const props = { enabled, ...restProps };
Expand Down Expand Up @@ -51,7 +51,7 @@ const RangeSelectorInner = ({ enabled = true, ...restProps }) => {
if (!children || !rendered) return null;

return (
<Hidden>{children}</Hidden>
<>{children}</>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { attempt } from 'lodash-es';
import { Hidden, useModifiedProps, useChart } from 'react-jsx-highcharts';
import { useModifiedProps, useChart } from 'react-jsx-highcharts';

const Scrollbar = ({ children, enabled = true, ...restProps }) => {
const chart = useChart();
Expand All @@ -23,7 +23,7 @@ const Scrollbar = ({ children, enabled = true, ...restProps }) => {
if (!children) return null;

return (
<Hidden>{children}</Hidden>
<>{children}</>
);
}

Expand Down

0 comments on commit 9d6664c

Please sign in to comment.