Introduced Server Side Rendering for Cloud Pages based on React
This commit is contained in:
1 parent
569b849457
commit
1d6772eef3
17 files changed
+456
-61
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import React from 'react'
|
||||
import {renderToStaticMarkup} from 'react-dom/server'
|
||||
|
||||
const App = require('../components/App')
|
||||
|
||||
function renderApp({menu, page}) {
|
||||
const app = (
|
||||
<App menu={menu}>
|
||||
<div dangerouslySetInnerHTML={{__html: page.data}}/>
|
||||
</App>
|
||||
)
|
||||
return renderToStaticMarkup(app)
|
||||
}
|
||||
|
||||
exports.renderApp = renderApp
|
||||
Reference in new issue
Block a user