hook to filter items from query parameters
npm install --save qs-filter
import React from 'react'
import { useFilterFromQueryParams } from 'qs-filter'
const App = () => {
const users: User[] = [
{
id: 1,
isActive: true,
isFinalized: false
},
{
id: 2,
isActive: false,
isFinalized: true
}
]
const filteredUsers = useFilterFromQueryParams(users)
return filteredUsers.map((user) => (
<>
<p>Id : {user.id}</p>
<p>isActive : {user.isActive.toString()}</p>
<p>isFinalized : {user.isFinalized.toString()}</p>
</>
))
}
MIT © mlfcnt