0

I want to set navigate to a different route when below link clicked.

<Link to={'/q/${item.qID}'} style={{ textDecoration: 'none' }}>{item.qContent}</Link>

The real result is

http://localhost:3000/q/$%7Bitem.qID%7D

Expected results is

http://localhost:3000/q/122

(122 = item.qID)

Dmap
  • 129
  • 2
  • 17

1 Answers1

0

The format is wrong, in order to use a dynamic string you have to wrap your string inside backtick character(`).

Ref

maya_nk99
  • 502
  • 3
  • 5