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'm trying to build my own component using useInfiniteHits. I wish to retain scroll position of a div element containing a list of items, after the user has edited one of the item in the list of hits.
loads UI with list of items using hits from useInfiniiteHits
click 3rd item in the list ( from page 1), which brings me to another page where i can make edits (e.g. edit the list item name)
save the edits and press 'x', page gets routed by react router to step 1
at step 3, I noticed that the list page seems to load from the hits in the in memory cache, and doesn't reflect the updated list item name, even though the scroll position was retained. How can make the item reflect the edited name in this case? I was thinking of tracking the page number of the item i selected, and make the component reload with this page number. Is it possible for me to access the cachedHits information in my memory cache in my component?
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
-
Hi,
I'm trying to build my own component using useInfiniteHits. I wish to retain scroll position of a div element containing a list of items, after the user has edited one of the item in the list of hits.
I tried implementing my own in memory cache, following some codesandbox i found from the docs. (https://codesandbox.io/p/sandbox/useinstantsearch-refresh-with-infinitehits-forked-sq7jox?file=%2Fsrc%2Fcomponents%2FRefreshableInfiniteHits.js)
so my flow goes like this:
at step 3, I noticed that the list page seems to load from the hits in the in memory cache, and doesn't reflect the updated list item name, even though the scroll position was retained. How can make the item reflect the edited name in this case? I was thinking of tracking the page number of the item i selected, and make the component reload with this page number. Is it possible for me to access the cachedHits information in my memory cache in my component?
Beta Was this translation helpful? Give feedback.
All reactions