🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@clubfactory_fe/react-ssr-utils

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clubfactory_fe/react-ssr-utils

utils for cf-react-ssr

latest
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
-100%
Maintainers
2
Weekly downloads
 
Created
Source

CF前端React服务端渲染工具函数

1. GetInitialProps

GetInitialProps 最为高级组件使用,解析页面组件的 getInitialProps属性。初始化页面时、路由变时调用 getInitialProps()

2.renderLayout

renderLayout 是切换为csr时,把layout渲染成html模板输出。

3.renderToStream

renderToStream 统一 react-dom 的 renderToString 和 renderToNodeStream,切用于保证前后端公用 react-dom

DEMO参考

http://gitlab.yuceyi.com/node_public/cf-react-ssr-demo

http://gitlab.yuceyi.com/node_public/node-web/-/merge_requests/301

流程图

FAQs

Package last updated on 26 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts