简体   繁体   中英

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.
<Link to={"/profile/" + user.id}>View </Link>

这就是你要找的

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM