Skip to content

Instantly share code, notes, and snippets.

@Blezzoh
Created February 25, 2020 02:28
Show Gist options
  • Save Blezzoh/2bbbdd9be180a905a82270ab9c4cbfa1 to your computer and use it in GitHub Desktop.
Save Blezzoh/2bbbdd9be180a905a82270ab9c4cbfa1 to your computer and use it in GitHub Desktop.
custom component for the global filter in react-table 7
// value and onChange function
const GlobalFilter = ({ globalFilter, setGlobalFilter }) => {
return (
<input
value={globalFilter || ""}
onChange={e => {
setGlobalFilter(e.target.value || undefined); // Set undefined to remove the filter entirely
}}
placeholder={`Search All ...`}
/>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment