You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the global filter, but i don't know how to fix the problem.
This is customTable.js
`
import React from 'react';
import { useTable, useGlabalFilter, useAsyncDebounce, useFilters } from 'react-table'
import './customTable.css'
import GlobalFilter from './globalFilter'
function CustomTable(props) {
function Table({ columns, data }) {
const {
getTableProps,
getTableBodyProps,
headerGroups,
rows,
prepareRow,
state,
setGlobalFilter
} = useTable({
columns,
data
},useGlabalFilter)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use the global filter, but i don't know how to fix the problem.
This is customTable.js
`
import React from 'react';
import { useTable, useGlabalFilter, useAsyncDebounce, useFilters } from 'react-table'
import './customTable.css'
import GlobalFilter from './globalFilter'
function CustomTable(props) {
function Table({ columns, data }) {
const {
getTableProps,
getTableBodyProps,
headerGroups,
rows,
prepareRow,
state,
setGlobalFilter
} = useTable({
columns,
data
},useGlabalFilter)
}
}
export default CustomTable;
`
And this is globalFilter.js
`
import React from 'react';
function GlobalFilter({ globalFilter, setGlobalFilter }) {
return (
Search: {' '}
<input value = { globalFilter || '' } onChange = { e => setGlobalFilter(e.target.value || undefined) } />
);
}
export default GlobalFilter;
`
Beta Was this translation helpful? Give feedback.
All reactions