mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 10:41:13 +08:00
chore(react): adding prettier and formating files
This commit is contained in:
@ -1,36 +1,43 @@
|
||||
import { SerializeDocumentOptions, renderToString } from '@ionic/core/hydrate';
|
||||
|
||||
export async function ionRenderToString(html: string, userAgent: string, options: SerializeDocumentOptions = {}) {
|
||||
export async function ionRenderToString(
|
||||
html: string,
|
||||
userAgent: string,
|
||||
options: SerializeDocumentOptions = {}
|
||||
) {
|
||||
const renderToStringOptions = Object.assign(
|
||||
{},
|
||||
{
|
||||
clientHydrateAnnotations: false,
|
||||
excludeComponents: [
|
||||
// overlays
|
||||
'ion-action-sheet',
|
||||
'ion-alert',
|
||||
'ion-loading',
|
||||
'ion-modal',
|
||||
'ion-picker',
|
||||
'ion-popover',
|
||||
'ion-toast',
|
||||
|
||||
const renderToStringOptions = Object.assign({}, {
|
||||
clientHydrateAnnotations: false,
|
||||
excludeComponents: [
|
||||
// overlays
|
||||
'ion-action-sheet',
|
||||
'ion-alert',
|
||||
'ion-loading',
|
||||
'ion-modal',
|
||||
'ion-picker',
|
||||
'ion-popover',
|
||||
'ion-toast',
|
||||
// navigation
|
||||
'ion-router',
|
||||
'ion-route',
|
||||
'ion-route-redirect',
|
||||
'ion-router-link',
|
||||
'ion-router-outlet',
|
||||
|
||||
// navigation
|
||||
'ion-router',
|
||||
'ion-route',
|
||||
'ion-route-redirect',
|
||||
'ion-router-link',
|
||||
'ion-router-outlet',
|
||||
// tabs
|
||||
'ion-tabs',
|
||||
'ion-tab',
|
||||
|
||||
// tabs
|
||||
'ion-tabs',
|
||||
'ion-tab',
|
||||
|
||||
// auxiliary
|
||||
'ion-picker-column',
|
||||
'ion-virtual-scroll'
|
||||
],
|
||||
userAgent
|
||||
}, options);
|
||||
// auxiliary
|
||||
'ion-picker-column',
|
||||
'ion-virtual-scroll',
|
||||
],
|
||||
userAgent,
|
||||
},
|
||||
options
|
||||
);
|
||||
|
||||
const ionHtml = await renderToString(html, renderToStringOptions);
|
||||
return ionHtml.html;
|
||||
|
Reference in New Issue
Block a user