Skip to content

Commit

Permalink
Merge pull request #19 from hnrchrdl/readme-fixes
Browse files Browse the repository at this point in the history
fix: readme - lookup usage
  • Loading branch information
theKashey authored May 30, 2020
2 parents be670cf + f02ac12 commit 99210da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ async function MyRender() {
// render App
const htmlStream = ReactDOM.renderToNodeStream(<App />)

const lookup = await stylesLookup;
await stylesLookup;
// create a style steam
const styledStream = createStyleStream(lookup, (style) => {
const styledStream = createStyleStream(stylesLookup, (style) => {
// _return_ link tag, and it will be appended to the stream output
return createLink(`dist/${style}`) // <link href="dist/mystyle.css />
});

// or create critical CSS stream - it will inline all styles
const styledStream = createCriticalStyleStream(projectStyles); // <style>.myClass {...
const styledStream = createCriticalStyleStream(stylesLookup); // <style>.myClass {...

// allow client to start loading js bundle
res.write(`<!DOCTYPE html><html><head><script defer src="client.js"></script>`);
Expand Down

0 comments on commit 99210da

Please sign in to comment.