How to use the react-helmet.rewind 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 Nebo15 / annon.web / app / server / page.js View on Github external
.then(() => {
        const reduxState = escape(JSON.stringify(getState()));
        const css = new Set();
        /* eslint-disable no-underscore-dangle */
        const html = ReactDOMServer.renderToString(
           { css.add(styles._getCss()); }}>
            
              { }
            
          
        );
        const head = Helmet.rewind();
        res.render('index', {
          html,
          reduxState,
          inlineCss: arrayFrom(css).join(''),
          head,
          isMobile,
        });
      })
      .catch(err => next(err));
github lifechurch / melos / feature-server.js View on Github external
getRenderProps(feature, params.url).then(nr.createTracer('getRenderProps', (renderProps) => {
						let html = null
						try {
							html = renderToString()
						} catch (ex) {
								// throw new Error(`Error: 3 - Could Not Render ${feature} view`, ex)
							Raven.captureException(ex)
							nr.endTransaction()
							res.status(500).send({ error: 3, message: `Could Not Render ${feature} view`, ex, stack: ex.stack })
						}

						const initialState = Object.assign({}, startingState, store.getState(), { hosts: { nodeHost: getNodeHost(req), railsHost: params.railsHost } })

						let head = Helmet.rewind()

						head = {
							base: head.base.toString(),
							meta: head.meta.toString(),
							link: head.link.toString(),
							title: head.title.toString(),
							script: head.script.toString()
						}

							// for lookinside stuff
						let referrer = null
						if (params.referrer) {
							referrer = params.referrer
						}

						res.setHeader('Cache-Control', 'public')
github reactGo / reactGo / app / components / Meta.jsx View on Github external
// in development mode
if (__DEVSERVER__) {
  config.link = config.link.filter(l => l.rel !== 'stylesheet');
}

const Meta = () => (
  
)


ReactDOMServer.renderToString();
const header = Helmet.rewind();

export default header;
github LearningLocker / learninglocker / ui / src / components / Html / index.js View on Github external
const html = ({
  protocol, // http or https
  style, // raw styles to be embedded directly into the document
  scripts, // scripts to be linked in the document body
  state, // initial state of the client side store
  children, // output of server side route render
}) => {
  const head = Helmet.rewind();

  return (
    
      
        {head.base.toComponent()}
        {head.title.toComponent()}
        {head.meta.toComponent()}
        {head.link.toComponent()}
        {head.script.toComponent()}
        
        
        
        {style &&
github wellyshen / react-cool-starter / src / utils / renderHtmlPage.js View on Github external
export default (store: Store, htmlApp: string = '') => {
  const head = Helmet.rewind();
  const assets = webpackIsomorphicTools.assets();

  // Setup html page
  return `
    
    
      
        
        
        
        
        

        ${head.base.toString()}
        ${head.title.toString()}
        ${head.meta.toString()}
github interledger-deprecated / ilp-kit / src / helpers / Html.js View on Github external
render () {
    const {assets, component, store} = this.props
    const content = component ? ReactDOM.renderToString(component) : ''
    const helmet = Helmet.rewind()

    return (
      
        
          {helmet.base.toComponent()}
          {helmet.title.toComponent()}
          {helmet.meta.toComponent()}
          {helmet.link.toComponent()}
          {helmet.script.toComponent()}

          
          
          
          {/* styles (will be present only in production with webpack extract text plugin) */}
github Availity / react-block-ui / docs / lib / app.js View on Github external
match({ routes, location: locals.path, basename }, (error, redirectLocation, renderProps) => {
    var url;

    if (redirectLocation && redirectLocation.pathname) {
      url = redirectLocation.pathname;
      callback(null, `
      
      
      
      
      
      `);
    }
    const body = ReactDOMServer.renderToString();
    const head = Helmet.rewind();
    let markup = `
      
        
          
          
          
          ${head.title.toString()}
          ${head.meta.toString()}
          
          
          
          
        
        
          <div id="app">${body}</div>
github emilyaviva / gatsby-starter-blog-multiple-authors / html.js View on Github external
const Html = ({ body }) =&gt;
  
    
      
      
      
      
      {Helmet.rewind().meta.toComponent()}
      {Helmet.rewind().title.toComponent()}
      {css}
    
    
      <div id="react-mount">
      </div>
github gthayer / monster-manager / src / middleware.js View on Github external
match({ routes, location: req.url }, (error, redirectLocation, renderProps) =&gt; {
		if(error) {
			res.status(500).send(error.message);
		} else if(redirectLocation) {
			res.redirect(302, redirectLocation.pathname + redirectLocation.search);
		} else if(renderProps) {

			let renderedBody = renderToString(
				 
					
				
			);

			let head = Helmet.rewind();

			res.status(200).send(`
				
				
					
						
						${head.title.toString()}
						${head.meta.toString()}

						
						
						
						
						
						
github dimroc / urbanevents / cityweb / src / app / client / router / toString.js View on Github external
match({ routes: createRoutes({store, first: { time: true }}), location: options.url }, (error, redirectLocation, renderProps) =&gt; {
      try {
        if (error) {
          result.error = error;

        } else if (redirectLocation) {
          result.redirect = redirectLocation.pathname + redirectLocation.search;

        } else {
          result.app = renderToString(
            
              
            
          );
          const { title, meta } = Helmet.rewind();
          result.title = title;
          result.meta = meta;
          result.initial = JSON.stringify(store.getState());
        }
      } catch (e) {
        result.error = e;
      }
      return callback(JSON.stringify(result));
    });
  } catch (e) {