@shopify/react-server
Version:
Utilities for React server-side rendering
25 lines (20 loc) • 726 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var shared = require('../shared.js');
function errorSSRComponentExists(options, compiler) {
return !shared.noSourceExists(shared.Entrypoint.Error, options, compiler);
}
function errorClientSource() {
return `
${shared.HEADER}
import React from 'react';
import ReactDOM from 'react-dom/client';
import {showPage} from '@shopify/react-html';
import Error from 'error';
const appContainer = document.getElementById('app');
ReactDOM.hydrateRoot(appContainer, React.createElement(Error));
showPage();
`;
}
exports.errorClientSource = errorClientSource;
exports.errorSSRComponentExists = errorSSRComponentExists;