@shopify/react-html
Advanced tools
Comparing version 2.0.10 to 3.0.1
@@ -30,3 +30,4 @@ /// <reference types="react" /> | ||
}; | ||
hideForInitialLoad?: boolean; | ||
} | ||
export default function HTML({children, blockingScripts, scripts, styles, data, headData}: Props): JSX.Element; | ||
export default function HTML({children, blockingScripts, scripts, styles, data, headData, hideForInitialLoad}: Props): JSX.Element; |
@@ -27,3 +27,3 @@ "use strict"; | ||
function HTML(_a) { | ||
var _b = _a.children, children = _b === void 0 ? '' : _b, _c = _a.blockingScripts, blockingScripts = _c === void 0 ? [] : _c, _d = _a.scripts, scripts = _d === void 0 ? [] : _d, _e = _a.styles, styles = _e === void 0 ? [] : _e, _f = _a.data, data = _f === void 0 ? {} : _f, _g = _a.headData, headData = _g === void 0 ? {} : _g; | ||
var _b = _a.children, children = _b === void 0 ? '' : _b, _c = _a.blockingScripts, blockingScripts = _c === void 0 ? [] : _c, _d = _a.scripts, scripts = _d === void 0 ? [] : _d, _e = _a.styles, styles = _e === void 0 ? [] : _e, _f = _a.data, data = _f === void 0 ? {} : _f, _g = _a.headData, headData = _g === void 0 ? {} : _g, hideForInitialLoad = _a.hideForInitialLoad; | ||
var markup = server_1.renderToString(children); | ||
@@ -42,7 +42,5 @@ var helmet = react_helmet_1.default.renderStatic(); | ||
}); | ||
/* eslint-disable no-process-env, no-undefined */ | ||
var bodyStyles = process.env.NODE_ENV === 'development' && blockingScripts.length > 0 | ||
? { display: 'none' } | ||
: undefined; | ||
/* eslint-enable no-process-env, no-undefined */ | ||
/* eslint-disable no-undefined */ | ||
var bodyStyles = hideForInitialLoad ? { display: 'none' } : undefined; | ||
/* eslint-enable no-undefined */ | ||
var headDataMarkup = Object.keys(headData).map(function (id) { | ||
@@ -49,0 +47,0 @@ return React.createElement(react_serialize_1.Serializer, { key: id, id: id, data: headData[id] }); |
{ | ||
"name": "@shopify/react-html", | ||
"version": "2.0.10", | ||
"version": "3.0.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A component to render your react app with no static HTML.", |
@@ -50,2 +50,3 @@ # `@shopify/react-html` | ||
data?: {[id: string]: any}; | ||
hideForInitialLoad?: boolean; | ||
} | ||
@@ -80,2 +81,5 @@ | ||
**hideForInitialLoad** | ||
Sets the body contents to be hidden for the initial render. Use this when injecting stylesheets dynamically in development in order to prevent a flash of unstyled content. | ||
### Serializers | ||
@@ -82,0 +86,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
124
0
25967
615