A
A
ayapergenov2019-04-23 08:48:43
React
ayapergenov, 2019-04-23 08:48:43

How to pass references from props in a loop?

In the loop, references to blocks from props are passed.
What syntax allows this to be done?
<Link to='/{item.anchor}'>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-04-23
@ayapergenov

Option 1: Use a template literal: MDN: Template Strings . Option 2. String concatenation:
<Link to={'/' + item.anchor}>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question