Skip to content

Commit

Permalink
removing _.isNil
Browse files Browse the repository at this point in the history
  • Loading branch information
HHongSeungWoo committed Oct 25, 2023
1 parent 29c993e commit be919e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chart/generateCategoricalChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ const createDefaultState = (props: CategoricalChartProps): CategoricalChartState
dataStartIndex: startIndex,
dataEndIndex: endIndex,
activeTooltipIndex: -1,
isTooltipActive: !_.isNil(defaultShowTooltip) ? defaultShowTooltip : false,
isTooltipActive: Boolean(defaultShowTooltip),
};
};

Expand Down Expand Up @@ -1173,7 +1173,7 @@ export const generateCategoricalChart = ({
): CategoricalChartState => {
const { dataKey, data, children, width, height, layout, stackOffset, margin } = nextProps;

if (_.isNil(prevState.updateId)) {
if (prevState.updateId === undefined) {
const defaultState = createDefaultState(nextProps);

return {
Expand Down Expand Up @@ -1640,7 +1640,7 @@ export const generateCategoricalChart = ({
const { updateId } = this.state;
const { dataStartIndex, dataEndIndex } = data;

if (!_.isNil(data.dataStartIndex) || !_.isNil(data.dataEndIndex)) {
if (data.dataStartIndex !== undefined || data.dataEndIndex !== undefined) {
this.setState({
dataStartIndex,
dataEndIndex,
Expand All @@ -1654,7 +1654,7 @@ export const generateCategoricalChart = ({
this.state,
),
});
} else if (!_.isNil(data.activeTooltipIndex)) {
} else if (data.activeTooltipIndex !== undefined) {
const { chartX, chartY } = data;
let { activeTooltipIndex } = data;
const { offset, tooltipTicks } = this.state;
Expand Down

0 comments on commit be919e1

Please sign in to comment.