Permalink
Browse files

@phenomic/plugin-renderer-react: expose html from renderApp()

That allows CSS-in-JS to easily optimize (critical) CSS extraction.
  • Loading branch information...
MoOx committed Oct 16, 2017
1 parent 1c997d6 commit 24f301aca59c2ba0b368123b0304836596b3fbd2
Showing with 4 additions and 2 deletions.
  1. +1 −0 flow/interfaces/phenomic.js
  2. +3 −2 packages/plugin-renderer-react/src/renderHTML.js
@@ -64,6 +64,7 @@ export type PhenomicHtmlPropsType = {
app: React$Element<any>
) => {
assets: PhenomicAssets,
html: string,
Main: ReactCompo,
State: ReactCompo,
Style: ReactCompo,
@@ -42,10 +42,11 @@ const renderHTML: PhenomicPluginRenderHTMLType = ({ config, props }) => {
const css = sets.filter(asset => asset.endsWith(".css")).shift();
const js = sets.filter(asset => asset.endsWith(".js")).shift();
return {
Main: () => (
html: main,
Main: ({ html = main }) => (
<div
id="PhenomicRoot"
dangerouslySetInnerHTML={{ __html: main || null }}
dangerouslySetInnerHTML={{ __html: html || null }}
/>
),
State: () =>

0 comments on commit 24f301a

Please sign in to comment.