material-react-table 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import React, {
|
|
|
4
4
|
MouseEvent,
|
|
5
5
|
useCallback,
|
|
6
6
|
useEffect,
|
|
7
|
+
useRef,
|
|
7
8
|
useState,
|
|
8
9
|
} from 'react';
|
|
9
10
|
import Box from '@mui/material/Box';
|
|
@@ -171,10 +172,13 @@ export const MRT_FilterTextField: FC<Props> = ({
|
|
|
171
172
|
setAnchorEl(event.currentTarget);
|
|
172
173
|
};
|
|
173
174
|
|
|
175
|
+
const isMounted = useRef(false);
|
|
176
|
+
|
|
174
177
|
useEffect(() => {
|
|
175
|
-
if (column.getFilterValue() === undefined) {
|
|
178
|
+
if (isMounted.current && column.getFilterValue() === undefined) {
|
|
176
179
|
handleClear();
|
|
177
180
|
}
|
|
181
|
+
isMounted.current = true;
|
|
178
182
|
}, [column.getFilterValue()]);
|
|
179
183
|
|
|
180
184
|
if (columnDef.Filter) {
|