Answer the question
In order to leave comments, you need to log in
How to correctly add addresses to NavLink using JS?
Hello! Next question.
How to correctly insert a link using variables?
For example
const link = 'home'
<NavLink to={link}>
const link = 'home'
<NavLink to='example/{link}'>
Answer the question
In order to leave comments, you need to log in
const links = [{id: 1, url: '/example'}, {id: 2, url: '/example2'}];
links.map(link => (<NavLink to={link.url} key={link.id}>))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question