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
Hello
This function is a search function with infinite scroll.
Everything is working well as I expected, but when I click the Link button(detail page) on page five and go back button, I see only 1 page of data and the scroll is at the bottom of 1 page. After that, I cannot scroll down anymore. I found that I needed to persist on the previous page.
I tried to use an atom, but I was not sure that was the answer.
Does anyone have a better idea of this?
export default function Search() {
const data = useLoaderData<typeof loader>();
const location = useLocation();
return <SearchPage key={location.key} data={data} />;
}
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
This function is a search function with infinite scroll.
Everything is working well as I expected, but when I click the Link button(detail page) on page five and go back button, I see only 1 page of data and the scroll is at the bottom of 1 page. After that, I cannot scroll down anymore. I found that I needed to persist on the previous page.
I tried to use an atom, but I was not sure that was the answer.
Does anyone have a better idea of this?
SearchPage.tsx
Beta Was this translation helpful? Give feedback.
All reactions