A
A
Andrey Ivanov2019-05-07 10:54:21
React
Andrey Ivanov, 2019-05-07 10:54:21

Why does the browser refresh the page when navigating to another page?

Why does the browser refresh the page when navigating to another page?

import Link from 'next/link';
<nav className="navigation">
                        <Link href="/proekty">
                            <a onClick={this.onToggleMenu} className="link">
                                Проекты
                            </a>
                        </Link>
                        <Link href="/agenstvo">
                            <a onClick={this.onToggleMenu} className="link">
                                Агентство
                            </a>
                        </Link>
                        <Link href="/kontakty">
                            <a onClick={this.onToggleMenu} className="link">
                                Контакты
                            </a>
                        </Link>
                        <Link href="/blog">
                            <a onClick={this.onToggleMenu} className="link">
                                Блог
                            </a>
                        </Link>
                    </nav>

import Router from 'next/router';
handlerScroll = () => {
        Router.push(`${this.props.path}`);
    };

When I go through the pages from the menu in the header, the page reloads, and if I do it while scrolling Router.push, it doesn’t reload, why?

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