@shopify/react-server
Version:
Utilities for React server-side rendering
20 lines (17 loc) • 605 B
JavaScript
import { noSourceExists, Entrypoint, HEADER } from '../shared.mjs';
function errorSSRComponentExists(options, compiler) {
return !noSourceExists(Entrypoint.Error, options, compiler);
}
function errorClientSource() {
return `
${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();
`;
}
export { errorClientSource, errorSSRComponentExists };