How to use the react-helmet.default.renderStatic function in react-helmet

To help you get started, we’ve selected a few react-helmet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github patternplate / patternplate / components / legacy / src / cover / index.js View on Github external
module.exports.head = () => {
  const head = Helmet.renderStatic();
  return [
    head.title.toString(),
    head.meta.toString(),
    head.link.toString(),
    head.style.toString(),
    head.script.toString(),
  ].join('\n');
};
github fiatjaf / sitio / static.js View on Github external
return e(Body, props,
    e(makeHelmet, props),
    e(props.page, props)
  )
}

var output = renderToString(e(Main, {
  page: require(process.env.STANDALONE),
  meta: require(process.env.STANDALONE).meta,
  pages: JSON.parse(process.env.ALLPAGESMETA),
  location: {
    pathname: process.env.PATHNAME,
    search: ''
  }
}))
var head = Helmet.renderStatic()

process.stdout.write(
  '' +
  '' +
  '' +
  head.meta.toString() +
  head.base.toString() +
  head.title.toString() +
  head.link.toString() +
  head.noscript.toString() +
  head.script.toString() +
  '' +
  '' + output + '' +
  ''
)
github velop-io / server / examples / 8-react-custom-html / server.js View on Github external
route.setHTML(({ element, clientStats, relayPayload }) => {
  const ReactDOM = require("react-dom/server");
  const Helmet = require("react-helmet").default;
  const flushChunks = require("webpack-flush-chunks").flushChunks;
  const flushChunkNames = require("react-universal-component/server")
    .flushChunkNames;
  const app = ReactDOM.renderToString(element);

  const { js, styles, cssHash } = flushChunks(clientStats, {
    chunkNames: flushChunkNames()
  });

  const helmet = Helmet.renderStatic();
  let title = helmet && helmet.title && helmet.title.toString();
  let meta = helmet && helmet.meta && helmet.meta.toString();

  return `
    
    

      
        
        
        ${title}
        ${meta}
        ${styles}