Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const GlobalFilter = ({ preGlobalFilteredRows, globalFilter, setGlobalFilter }: any) => {
const [value, setValue] = React.useState(globalFilter);
if (!globalFilter && value) {
setGlobalFilter(value);
}
const onChange = useAsyncDebounce((value) => {
setGlobalFilter(value || undefined);
}, 200);
return (
{
setValue(e.target.value);
onChange(e.target.value);
}}
placeholder="Filter"
/>