Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
fix(RatingMenu): use lodash fill instead of native one
Browse files Browse the repository at this point in the history
  • Loading branch information
samouss committed Mar 27, 2018
1 parent 022daeb commit be1ace0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react-instantsearch/src/components/RatingMenu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { find } from 'lodash';
import { find, fill } from 'lodash';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
Expand Down Expand Up @@ -145,8 +145,7 @@ class RatingMenu extends Component {
.map(item => ({ ...item, value: parseFloat(item.value) }))
.filter(item => item.value >= limitMin && item.value <= limitMax);

const range = new Array(safeInclusiveLength)
.fill(null)
const range = fill(new Array(safeInclusiveLength), null)
.map((_, index) => {
const element = find(values, item => item.value === limitMax - index);
const placeholder = { value: limitMax - index, count: 0, total: 0 };
Expand Down

0 comments on commit be1ace0

Please sign in to comment.