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
Hi,
we are using the @klevu-core for the project, developed using Next Js and we want to run some snippet code after search functionality which is available in klevu documentation, I referred to the functionality of SearchResultPage.tsx from GitHub pages. Also, I used the same functionality from Klevu Documentation but render it multiple times like 3 to 4 times. So is there any solution for running snippet code after the search functionality and a solution to prevent multiple renders in use callback function? We refer below documentation for our Project.
Hi,
we are using the @klevu-core for the project, developed using Next Js and we want to run some snippet code after search functionality which is available in klevu documentation, I referred to the functionality of SearchResultPage.tsx from GitHub pages. Also, I used the same functionality from Klevu Documentation but render it multiple times like 3 to 4 times. So is there any solution for running snippet code after the search functionality and a solution to prevent multiple renders in use callback function? We refer below documentation for our Project.
const initialFetch = useCallback(async () => {
const modifiers = [
listFilters({
include: ["color", "", "size", "designer"],
rangeFilterSettings: [
{
key: "klevu_price",
minMax: true,
},
],
filterManager: manager,
}),
applyFilterWithManager(manager),
sendSearchEvent(),
]
}, [sorting, query])
const fetchMore = async () => {
const nextRes = await nextFunc({
filterManager: manager,
})
}
const handleFilterUpdate = () => {
setOptions(manager.options)
setSliders(manager.sliders)
initialFetch()
}
React.useEffect(() => {
const stop = KlevuListenDomEvent(
KlevuDomEvents.FilterSelectionUpdate,
handleFilterUpdate
)
}, [location.pathname, query, sorting])
useEffect(() => {
initialFetch()
}, [sorting, query, location.pathname])
The text was updated successfully, but these errors were encountered: