Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const React = require('react');
const Helmet = require('react-helmet').default;
const projectShape = require('./projectshape.jsx').projectShape;
const Meta = props => {
const {title, instructions, author} = props.projectInfo;
// Do not want to render any meta tags unless all the info is loaded
// Check only author (object) because it is ok to have empty string instructions
if (!author) return null;
const truncatedInstructions = instructions.split(' ')
.slice(0, 50)
.join(' ');
return (
router.get("/*", (ctx, next) => {
const context = {};
const { req } = ctx;
const store = store_1.default();
try {
store.dispatch(store_1.initializeSession());
const reactDom = render_dom_1.default(context, req, store);
const reduxState = store.getState();
const helmetData = react_helmet_1.default.renderStatic();
ctx.status = 200;
ctx.set("Content-Type", "text/html");
ctx.body = utils_1.htmlTemplate(reactDom, reduxState, helmetData);
} catch (err) {
console.log(err);
next();
}
});
app
const React = require('react');
const Helmet = require('react-helmet').default;
const objectEntries = require('object.entries');
const objectAssign = require('object-assign');
const HelmetDatoCms = ({ seo, favicon, children, ...rest }) => {
return React.createElement(
Helmet,
rest,
(seo ? seo.tags : [])
.concat(favicon ? favicon.tags : [])
.map((item, i) =>
React.createElement(
item.tagName,
objectAssign(
{ key: `helmet-datocms-${i}` },
objectEntries(item.attributes || {}).reduce(
(acc, [name, value]) => {
const React = require('react');
const Helmet = require('react-helmet').default;
const FormattedMessage = require('react-intl').FormattedMessage;
const FlexRow = require('../../components/flex-row/flex-row.jsx');
require('./not-available.scss');
const ProjectNotAvailable = () => (
<title>Scratch - Imagine, Program, Share</title>
<div>
<img src="/images/404-giga.png"></div>
const Helmet = require("react-helmet").default;
const React = require("react");
const styled = require("styled-components").default;
const createGlobalStyle = require("styled-components").createGlobalStyle;
const ThemeProvider = require("styled-components").ThemeProvider;
const getThemes = require("@patternplate/component-themes").getThemes;
const Favicon = require("./favicon");
const Components = require("../");
module.exports.default = Cover;
module.exports.head = () => {
const head = Helmet.renderStatic();
return [
head.title.toString(),
head.meta.toString(),
head.link.toString(),
const Contact = () =>
React.createElement(
"div",
null,
React.createElement("h2", null, "This is the contact page"),
React.createElement(
react_helmet_1.default,
null,
React.createElement("title", null, "Contact Page"),
React.createElement("meta", {
name: "description",
content: "This is a proof of concept for React SSR"
})
)
);
exports.default = Contact;
var React = require('react')
var renderToString = require('react-dom/server').renderToString
var Helmet = require('react-helmet').default
var e = React.createElement
var Main = function ReactSiteMain (props) {
var Body = require(process.env.BODY)
var makeHelmet = require(process.env.HELMET)
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),
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 `