V 6.5.3
I'm using tableRef.filterColumn method fired by redux actions from external components.
For each column I have custom methods that's handling the filter and is working well, the problem is when I try to clean all filtered columns in one action.
I've tried table.setState({filtered:[]}) also map all filtered columns calling filterColumn like this filteredColumns.map((column) => table.filterColumn(table.props.columns[column], ''));
none of them works is there a better way to handle external custom filters?
I'm avoiding filtering the data manually since the component provides the feature, but before doing this last try I'd like to know if there is a better way to force the component re-rendering
This is a similar example of what I'm trying to archive using both ideas I explained, although I'm using external component dispatching redux action and using sagas to handle the side effects.
https://codesandbox.io/s/n055o7z40l
The problem with the loop solution is that sometimes it works sometime it clears just one of them.
Probably there is a better way to implement custom filters from external components, just couldn't figure it out.
Thanks for helping!
I think you are probably better off pushing this onto the Slack #react-table channel. However, the easiest way to set a filter is to use the filtered prop. If you set the conditions that way and pass it in, then you only need to set it to an empty array to clear it.
Thanks @gary-menzel I've tried to find the slack chat I saw in a post on Medium but was a broken link so I though you guys had closed it. Now I found the right one.
I'm gonna ask people there.
Cheers!
this is the solution