javascript - react-router使用Link传递参数
阿神
阿神 2017-04-10 17:16:26
0
1
272

照着官方的栗子来的
<Link to={{ pathname: '/user/bob', query: { showAge: true } }} activeClassName="active">Bob With Query Params</Link>
但是点击的时候浏览器却提示
Warning: Failed propType: Invalid prop to of type object supplied to Link, expected string. Check the render method of app.
换成 to=“/”就没问题了,but why?to后面只能接字符串不能是变量,那官方的栗子是怎么回事呢?求助啊大大们...

阿神
阿神

闭关修行中......

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!