Comments (2)
不需要, 只需要在路由对应的页面组件新增静态方法即可,注意不要在willmount中调用浏览器对象
export default class Page extends Component {
state = {};
static getInitialProps () {
}
render() {
return (
<section>
test
</section>
);
}
}
from egg-react-ssr.
感谢 ~ 真的是很好的一个方案~
from egg-react-ssr.
Related Issues (20)
- CSR渲染使用useReactToString或者isRax会报错 HOT 1
- 脚手架问题 HOT 8
- 浏览器端接手数据怎么获取 HOT 1
- config.ssr生产环境路径问题 HOT 3
- dist文件里面的d.ts是必须的吗? 如果不是如何阻止生成 HOT 1
- 打包的文件是否支持Hash。如何解决浏览器缓存问题。 HOT 2
- 钉钉二维码已过期 HOT 2
- 针对layout优化还是不太理解 HOT 7
- getIntialProps里对象嵌套对象会失效,是只能用平级数据嘛 HOT 3
- CRA 迁移文档有木有 HOT 2
- 关于用loadable分割加载css的问题 HOT 32
- 我司商城项目正在使用此框架 HOT 2
- 在example中的ssr-with-ts项目里yarn prod 之后报错 HOT 1
- head标签嵌入功能 HOT 8
- 使用你们的框架重构了我们公司的官网 HOT 2
- SSR模式下引入antd 没有交互 HOT 1
- 为什么 npm prod 之后 请求的静态资源报错 HOT 1
- 按照官网教程来安装,启动就报错了,模板是 nestjs-react-ssr HOT 2
- ssr-with-js template 启动不正确 HOT 1
- 使用嵌套路由时,会出现含有路由组件的父组件被卸载的问题 HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egg-react-ssr.