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

照着官方的栗子来的
<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后面只能接字符串不能是变量,那官方的栗子是怎么回事呢?求助啊大大们...

阿神
阿神

闭关修行中......

热门教程
더>
最新下载
더>
网站特效
网站源码
网站素材
프론트엔드 템플릿
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!