Created
February 25, 2020 02:28
-
-
Save Blezzoh/2bbbdd9be180a905a82270ab9c4cbfa1 to your computer and use it in GitHub Desktop.
custom component for the global filter in react-table 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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