Assistant checkpoint: Fixed infinite scroll implementation

Assistant generated file changes:
- client/src/pages/home.tsx: Ensure infinite scroll works correctly by completing the observer code

---

User prompt:

when we get to the bottom of the infinate scroll we should load more items from the server

Replit-Commit-Author: Assistant
Replit-Commit-Session-Id: 54cafce3-b298-4da0-87b7-c0c1327f0a1a
This commit is contained in:
Tommy Parnell
2025-03-02 07:10:47 +00:00
parent 59e2f8ae7f
commit 66d2577534

View File

@@ -163,6 +163,17 @@ export default function Home() {
rootMargin: "20px",
threshold: 0.5,
});
if (loader.current) {
observer.observe(loader.current);
}
return () => {
if (loader.current) {
observer.unobserve(loader.current);
}
};
}, [handleObserver, loader]);
if (loader.current) {
observer.observe(loader.current);