Jessie Emerson
Jessie Emerson

Reputation: 743

Link param doesn't render in JSX (react)

<Link to={{pathname:'/profile',query: {id: {user.id}}}>View </Link>

I want to render a link that go to a path, but in my dom I see profile/user?user.id

Early on I tried something more simple

<Link to="/profile/{user.id}">View </Link> it doesn't work too.

Upvotes: 0

Views: 238

Answers (1)

Stannio
Stannio

Reputation: 101

<Link to={"/profile/" + user.id}>View </Link>

This is what you're looking for

Upvotes: 1

Related Questions