Introduced Server Side Rendering for Cloud Pages based on React

This commit is contained in:
tmshv committed 2017-05-20 23:24:18 +03:00
1 parent 569b849457
commit 1d6772eef3
17 files changed
+456 -61

No files matched your search

+15
View File
@@ -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