When I scroll page and then realod it , it return me in the same position even after scroll(0,0) have betten exectuted , how to prevent it?

后端 未结 0 977
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 06:27
  useEffect(() => {
    window.scrollTo(0, 0)
  }, [])

I do scroll to the top by this snippet of code, also I\'ve tried to make it ref like this:

相关标签:
回答
  • 消灭零回复
提交回复
热议问题