Scroll to top of article page when viewing new content
Ensure the page scrolls to the top when a new article slug is loaded by adding a useEffect hook. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 413891e8-d784-4bea-b9f5-91a5a68316b4 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 87110da8-2cc4-433f-9d49-0af7ca1b4fa5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/413891e8-d784-4bea-b9f5-91a5a68316b4/kmpcO4B Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
ace36af756
commit
3d38b22fee
@ -97,6 +97,10 @@ export default function ArticlePage() {
|
||||
queryKey: ["/api/articles", slug],
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, [slug]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!article?.content) return;
|
||||
if (article.content.includes("instagram.com")) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user