R
R
rgrishin2022-04-06 16:37:29
React
rgrishin, 2022-04-06 16:37:29

When moving to another page, the transition is not to the top of the page. How to fix?

Hello everyone

On the main page of the SPA application there is a link to the login page, when you click on it, you go to this page, but not to its beginning, but to the same height that the main page was scrolled to. The routes in app.js are:

<Routes>
            <Route path="/" element={<Main/>} />
            <Route path="/login" element={<Login/>} />
            <Route path="/password" element={<Password/>} />
            <Route path="*" element ={<NotFound/>}/>
</Routes>


Tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question