@shopify/react-html
Version:
A component to render your React app with no static HTML
21 lines (18 loc) • 421 B
JavaScript
import React from 'react';
import serialize from 'serialize-javascript';
import { SERIALIZE_ATTRIBUTE } from '../../utilities.mjs';
function Serialize({
id,
data
}) {
return /*#__PURE__*/React.createElement("script", {
type: "text/json",
dangerouslySetInnerHTML: {
__html: serialize(data, {
isJSON: true
})
},
[SERIALIZE_ATTRIBUTE]: id
});
}
export { Serialize as default };