Closed aldabil21 closed 2 years ago
使用React Router Link component, 指nested route没有问题, 如: <Link to="detail/abc" ... => /detail/abc
Link
<Link to="detail/abc" ...
/detail/abc
问题在于:
如: <Link to="/" ... => // => mismatch error <Link to="//domain.com" ... => ///domain.com => mismatch error
<Link to="/" ...
//
<Link to="//domain.com" ...
///domain.com
导致: Warning: Prop `href` did not match. Server: "//" Client: "/"
Warning: Prop `href` did not match. Server: "//" Client: "/"
应该 <Link to="/" ... => / <Link to="//domain.com" ... => //domain.com
/
//domain.com
ssr-plugin-react@6.2.34
仓库
Static Router prefix是否可以忽略?
详细描述你的问题
使用React Router
Link
component, 指nested route没有问题, 如:<Link to="detail/abc" ...
=>/detail/abc
问题在于:
如:
<Link to="/" ...
=>//
=> mismatch error<Link to="//domain.com" ...
=>///domain.com
=> mismatch error导致:
Warning: Prop `href` did not match. Server: "//" Client: "/"
期望的结果
应该
<Link to="/" ...
=>/
<Link to="//domain.com" ...
=>//domain.com
当前使用的版本
ssr-plugin-react@6.2.34
仓库
Static Router prefix是否可以忽略?