diff --git a/packages/visx-axis/src/axis/Axis.tsx b/packages/visx-axis/src/axis/Axis.tsx index cb02f3d99..b5807e18c 100644 --- a/packages/visx-axis/src/axis/Axis.tsx +++ b/packages/visx-axis/src/axis/Axis.tsx @@ -47,8 +47,8 @@ export default function Axis({ ); const filteredTickValues = (tickValues ?? getTicks(scale, numTicks)) - .map((value, index) => ({ value, index })) - .filter(({ value }) => !hideZero || (value !== 0 && value !== '0')); + .filter(value => !hideZero || (value !== 0 && value !== '0')) + .map((value, index) => ({ value, index })); const ticks = filteredTickValues.map(({ value, index }) => { const scaledValue = coerceNumber(tickPosition(value)); diff --git a/packages/visx-axis/test/Axis.test.tsx b/packages/visx-axis/test/Axis.test.tsx index 9bae24cce..3377e595d 100644 --- a/packages/visx-axis/test/Axis.test.tsx +++ b/packages/visx-axis/test/Axis.test.tsx @@ -118,7 +118,7 @@ describe('', () => { .find('.visx-axis-tick') .at(0) .key(), - ).toBe('visx-tick-1-1'); + ).toBe('visx-tick-1-0'); }); test('it should SHOW an axis line if hideAxisLine is false', () => {