zhangyuang / ssr

A most advanced ssr framework support React17/React18/Vue2/Vue3 on Earth that implemented serverless-side render specification.
http://doc.ssr-fc.com/
MIT License
2.61k stars 284 forks source link

React Router: Prop `href` did not match问题 #228

Closed aldabil21 closed 2 years ago

aldabil21 commented 2 years ago

详细描述你的问题

使用React Router Link component, 指nested route没有问题, 如: <Link to="detail/abc" ... => /detail/abc

问题在于:

  1. 从nested page指首页
  2. 或用absolute path

如: <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是否可以忽略?