Skip to content

Commit

Permalink
comparing two objects using lodash.isEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-andreyev committed Apr 6, 2020
1 parent cde5a39 commit 954e698
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ra-core/src/controller/useFilterState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useRef, useState, useCallback } from 'react';
import debounce from 'lodash/debounce';
import isEqual from 'lodash/isEqual';
import { Filter } from '../types';

interface UseFilterStateOptions {
Expand Down Expand Up @@ -63,7 +64,7 @@ export default ({
});

useEffect(() => {
if (permanentFilterProp.current !== permanentFilter) {
if (!isEqual(permanentFilterProp.current, permanentFilter)) {
permanentFilterProp.current = permanentFilter;
setFilterValue({
...permanentFilter,
Expand Down

0 comments on commit 954e698

Please sign in to comment.