How to use the react-helmet.Helmet 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 jedireza / aqua / server / web / main / index.js View on Github external
internals.routeHandler = function (request, reply) {

    const routerState = {};
    const routerProps = {
        location: request.url.path,
        context: routerState
    };
    const AppUniversal = require('../../../client/pages/main/app-universal.jsx');
    const AppEl = React.createElement(AppUniversal);
    const App = React.createElement(StaticRouter, routerProps, AppEl);
    const markup = ReactDomServer.renderToString(App);
    const helmet = ReactHelmet.Helmet.renderStatic(); // leaks if not called after render

    if (routerState.url) {
        return reply().redirect(routerState.url).code(routerState.code);
    }

    const response = reply.view('main/index', {
        helmet,
        markup,
        state: request.app.state
    });

    if (routerState.code) {
        response.code(routerState.code);
    }

    if (request.app.headers) {
github olymp / olymp / external / ui / hotjar.js View on Github external
exports.default = function (_ref) {
  var children = _ref.children,
      id = _ref.id;
  return _react2.default.createElement(
    _reactHelmet.Helmet,
    null,
    id && _react2.default.createElement(
      'script',
      null,
      '\n            (function(h,o,t,j,a,r){\n              h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n              h._hjSettings={hjid:' + id + ',hjsv:5};\n              a=o.getElementsByTagName(\'head\')[0];\n              r=o.createElement(\'script\');r.async=1;\n              r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n              a.appendChild(r);\n            })(window,document,\'//static.hotjar.com/c/hotjar-\',\'.js?sv=\');\n          '
    )
  );
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV4dGVybmFsL3VpL2hvdGphci5lczYiXSwibmFtZXMiOlsiY2hpbGRyZW4iLCJpZCJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7QUFDQTs7OztrQkFFZTtBQUFBLE1BQUdBLFFBQUgsUUFBR0EsUUFBSDtBQUFBLE1BQWFDLEVBQWIsUUFBYUEsRUFBYjtBQUFBLFNBQ1o7QUFBQTtBQUFBO0FBQ0VBLFVBQ0M7QUFBQTtBQUFBO0FBQUEsK0pBSThCQSxFQUo5QjtBQUFBO0FBRkgsR0FEWTtBQUFBLEMiLCJmaWxlIjoiZXh0ZXJuYWwvdWkvaG90amFyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IEhlbG1ldCB9IGZyb20gJ3JlYWN0LWhlbG1ldCc7XG5cbmV4cG9ydCBkZWZhdWx0ICh7IGNoaWxkcmVuLCBpZCB9KSA9PlxuICAoPEhlbG1ldD5cbiAgICB7aWQgJiZcbiAgICAgIDxzY3JpcHQ+XG4gICAgICAgIHtgXG4gICAgICAgICAgICAoZnVuY3Rpb24oaCxvLHQsaixhLHIpe1xuICAgICAgICAgICAgICBoLmhqPWguaGp8fGZ1bmN0aW9uKCl7KGguaGoucT1oLmhqLnF8fFtdKS5wdXNoKGFyZ3VtZW50cyl9O1xuICAgICAgICAgICAgICBoLl9oalNldHRpbmdzPXtoamlkOiR7aWR9LGhqc3Y6NX07XG4gICAgICAgICAgICAgIGE9by5nZXRFbGVtZW50c0J5VGFnTmFtZSgnaGVhZCcpWzBdO1xuICAgICAgICAgICAgICByPW8uY3JlYXRlRWxlbWVudCgnc2NyaXB0Jyk7ci5hc3luYz0xO1xuICAgICAgICAgICAgICByLnNyYz10K2guX2hqU2V0dGluZ3MuaGppZCtqK2guX2hqU2V0dGluZ3MuaGpzdjtcbiAgICAgICAgICAgICAgYS5hcHBlbmRDaGlsZChyKTtcbiAgICAgICAgICAgIH0pKHdpbmRvdyxkb2N1bWVudCwnLy9zdGF0aWMuaG90amFyLmNvbS9jL2hvdGphci0nLCcuanM/c3Y9Jyk7XG4gICAgICAgICAgYH1cbiAgICAgIDwvc2NyaXB0Pn1cbiAgPC9IZWxtZXQ+KTtcbiJdfQ==
github jedireza / aqua / client / pages / main / login / reset / index.jsx View on Github external
'use strict';
const Actions = require('../actions');
const Button = require('../../../../components/form/button.jsx');
const ControlGroup = require('../../../../components/form/control-group.jsx');
const PropTypes = require('prop-types');
const React = require('react');
const ReactHelmet = require('react-helmet');
const ReactRouter = require('react-router-dom');
const Spinner = require('../../../../components/form/spinner.jsx');
const Store = require('./store');
const TextControl = require('../../../../components/form/text-control.jsx');


const Helmet = ReactHelmet.Helmet;
const Link = ReactRouter.Link;
const propTypes = {
    match: PropTypes.object
};


class ResetPage extends React.Component {
    constructor(props) {

        super(props);

        this.input = {};
        this.state = Store.getState();
    }

    componentDidMount() {
github escherpad / escherpad / web-app / server-src-build / pages / 404.js View on Github external
function NoMatch(props) {
    return _react2.default.createElement(
        Styled,
        { fill: true, column: true },
        _react2.default.createElement(
            _reactHelmet.Helmet,
            null,
            _react2.default.createElement(
                "title",
                null,
                "Page Not Found"
            )
        ),
        _react2.default.createElement(_layoutComponents.FlexSpacer, null),
        _react2.default.createElement(
            _layoutComponents.FlexItem,
            { fixed: true, component: 'div' },
            _react2.default.createElement(
                "h1",
                null,
                "404"
            ),
github escherpad / escherpad / web-app / server-src-build / pages / Todo.js View on Github external
function Escherpad(props) {
    return _react2.default.createElement(
        Styled,
        { fill: true, column: true, style: { backgroundImage: "linear-gradient(-40deg, #9710D5, #FF6A1A)" } },
        _react2.default.createElement(
            _reactHelmet.Helmet,
            null,
            _react2.default.createElement(
                "title",
                null,
                "Todo List"
            )
        ),
        _react2.default.createElement(
            "div",
            { style: { width: "700px", margin: "0 auto" } },
            _react2.default.createElement("input", { style: {
                    fontSize: '2.5em',
                    fontWeight: '200',
                    marginTop: '250px',
                    marginBottom: '25px',
                    border: "none",
github mgrip / startd / lib / server.js View on Github external
app.use(async ctx => {
  let bundlePath = `/${BUNDLE_PATH}`;

  if (typeof DEV_PORT !== "undefined") {
    bundlePath = `${ctx.origin.substring(0, ctx.origin.lastIndexOf(":"))}:${DEV_PORT}/${BUNDLE_PATH}`;
  }

  const appMarkup = (0, _server.renderToString)(_react.default.createElement(App, {
    ctx: ctx,
    startd: ctx.state.startd
  }));

  const helmet = _reactHelmet.Helmet.renderStatic();

  ctx.type = "html";
  ctx.body = `
    
      
        
        
        ${helmet.title.toString()}
        ${helmet.meta.toString()}
        ${helmet.link.toString()}
        ${helmet.style.toString()}
      
      
github jedireza / aqua / client / pages / main / about / index.jsx View on Github external
'use strict';
const React = require('react');
const ReactHelmet = require('react-helmet');


const Helmet = ReactHelmet.Helmet;


class AboutPage extends React.Component {
    render() {

        return (
            <section>
                
                    <title>About us</title>
                
                <div>
                    <div>
                        <h1>About us</h1>
                        <div>
                            <div>
                                <div></div></div></div></div></div></section>
github jedireza / aqua / client / pages / main / not-found.jsx View on Github external
'use strict';
const React = require('react');
const ReactHelmet = require('react-helmet');
const RouteStatus = require('../../components/route-status.jsx');


const Helmet = ReactHelmet.Helmet;


class NotFoundPage extends React.Component {
    render() {

        return (
            
                <section>
                    
                        <title>Page not found</title>
                    
                    <h1>Page not found</h1>
                    <p>We couldn’t find the page you requested.</p>
                </section>
            
        );
github jedireza / aqua / client / pages / main / login / forgot / index.jsx View on Github external
'use strict';
const Actions = require('../actions');
const Button = require('../../../../components/form/button.jsx');
const ControlGroup = require('../../../../components/form/control-group.jsx');
const React = require('react');
const ReactHelmet = require('react-helmet');
const ReactRouter = require('react-router-dom');
const Spinner = require('../../../../components/form/spinner.jsx');
const Store = require('./store');
const TextControl = require('../../../../components/form/text-control.jsx');


const Helmet = ReactHelmet.Helmet;
const Link = ReactRouter.Link;


class ForgotPage extends React.Component {
    constructor(props) {

        super(props);

        this.input = {};
        this.state = Store.getState();
    }

    componentDidMount() {

        this.unsubscribeStore = Store.subscribe(this.onStoreChange.bind(this));