Skip to content

Instantly share code, notes, and snippets.

@Blezzoh
Created February 25, 2020 00:00
Show Gist options
  • Save Blezzoh/679f15b0b55e2173d4d0dceae3c34560 to your computer and use it in GitHub Desktop.
Save Blezzoh/679f15b0b55e2173d4d0dceae3c34560 to your computer and use it in GitHub Desktop.
const ColumnFilter = ({ column: { filterValue, setFilter, filter } }) => {
return (
<input
value={filterValue || ""}
onChange={e => {
setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely
}}
placeholder={`Search ${filter ? filter : ""}...`}
/>
);
};
const defaultColumn = {
// Let's set up our default Filter UI
Filter: ColumnFilter
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment