SyntaxFix
Write A Post
Hire A Developer
Questions
This works for me.
import React, { useEffect } from 'react'; useEffect(() => { const body = document.querySelector('#root'); body.scrollIntoView({ behavior: 'smooth' }, 500) }, []);