-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
想问下服务端渲染可以用 hashHistory 这种方式吗 #10
Comments
两种方案都是可行的,客户端和服务端的match都要传hashHistory |
React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server: |
请重启服务器 |
不对,我的客户端代码是 : 还有如果我改成 browserHistory ,服务端是不是要定义2个端口?一个用来拦截所以的请求/*,一个用来请求真正的API,比如首页localhost会被localhost:2020拦截,返回html,但是里面的数据fetch请求实际到实际是localhost:3030,不然如果我fetch请求 localhost:2020的他都会返回html给我 |
一个端口就可以了,合理使用koa的中间件参数next,匹配到API url请求API接口,匹配到hash路由交给客户端处理 |
有没有示例, |
开始项目是 hashHistory这种方式的,我试了下服务端渲染,但是只能渲染首页,其他路由页面的渲染不了,是不是必须改成 browserHistory?
The text was updated successfully, but these errors were encountered: