Replies: 1 comment
-
After some investigation, I found that the issue was in the const useControlledState = (state: any) => {
useEffect(() => {
if (state.filters.length > 0) {
doSomethingWithFilters(state.filters);
}
}, [state.filters]);
return useMemo(() => state, [state]);
}; This caused the const debounceFilters = useRef(
debounce((filters: any) => {
doSomethingWithFilters(filters);
}, 100)
).current;
const useControlledState = (state: any) => {
useEffect(() => {
if (state.filters.length > 0) {
debounceFilters(state.filters);
}
return () => debounceFilters.cancel();
}, [state.filters]);
return useMemo(() => state, [state]);
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
In my application, I need to get the length of the table's
filteredRows
. However, after trying some different approaches, I didn't find a proper way of doing this.Some things I've tried:
React Router caught the following error during render Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
)useState
react hookBeta Was this translation helpful? Give feedback.
All reactions