“React Link против Navlink” Ответ

Ссылка против NAVLINK в REACT ROUTER

Link and NavLink work almost the same, but NavLink help us to highlt the active link
by provding us with a another attribute called activeClassName={yourClassName},
  which work on active classes.
  So it's better to use NavLink as compare to the Link component.
Dull Dingo

React Link против Navlink

<NavLink>

A special version of the <Link> that will add styling attributes 
to the rendered element when it matches the current URL.
ofroog

Ссылка против NAVLINK в RACT-ROUTER-DOM

When should I use the NavLink?

Just as the name implies 'NavLink', we use it mostly on navigation bars. This is because the active class permits us to define our custom styling in the App.css stylesheet. As such, we can use it to style our active buttons which in notify the use on which page he/she is currently on.

When should I use the Link?

The Link tag can be used where we want to do just some routing with no special effect. For instance; we can use the Link tag for scroll-to-top button, add to card buttons, submit button and more.
Mappy Show

Ответы похожие на “React Link против Navlink”

Вопросы похожие на “React Link против Navlink”

Больше похожих ответов на “React Link против Navlink” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования