-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can you add an example with function components and hooks #68
Comments
Does this help? import React, { useState } from "react";
import ReactFilterBox, { SimpleResultProcessing } from "react-filter-box";
const options = [
{
columnField: "Name",
type: "text",
},
{
columnField: "Description",
type: "text",
},
{
columnField: "Status",
type: "selection", // when using type selection, it will automatically suggest all possible values
},
{
columnText: "Email @",
columnField: "Email",
type: "text",
},
];
function Demo(props) {
const [data, setData] = useState([]); // pass your data in here instead of empty array
const onParseOk = (expressions) => {
const newData = new SimpleResultProcessing(options).process(
data,
expressions
);
// your new data here, which is filtered out of the box by SimpleResultProcessing
setData(newData);
};
return (
<>
<ReactFilterBox
data={data}
options={options}
onParseOk={onParseOk}
/>
</>
);
}
export default Demo; |
does it runs on next js |
I don't know. try it! |
nope this package doesn't support next js or to be more precise SSR Frontend architecture |
HI, Is there a way to clear the input filed data after the search or on clicking the custom clear button. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: