mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 01:52:19 +08:00
fix(react): setupIonicReact no longer crashes in SSR environment (#24604)
This commit is contained in:
@ -21,24 +21,23 @@ const getHelperFunctions = () => {
|
||||
export const IonicVue: Plugin = {
|
||||
|
||||
async install(_: App, config: IonicConfig = {}) {
|
||||
if (typeof (window as any) !== 'undefined') {
|
||||
|
||||
/**
|
||||
* By default Ionic Framework hides elements that
|
||||
* are not hydrated, but in the CE build there is no
|
||||
* hydration.
|
||||
* TODO: Remove when all integrations have been
|
||||
* migrated to CE build.
|
||||
*/
|
||||
/**
|
||||
* By default Ionic Framework hides elements that
|
||||
* are not hydrated, but in the CE build there is no
|
||||
* hydration.
|
||||
* TODO: Remove when all integrations have been
|
||||
* migrated to CE build.
|
||||
*/
|
||||
if (typeof (document as any) !== 'undefined') {
|
||||
document.documentElement.classList.add('ion-ce');
|
||||
|
||||
const { ael, rel, ce } = getHelperFunctions();
|
||||
initialize({
|
||||
...config,
|
||||
_ael: ael,
|
||||
_rel: rel,
|
||||
_ce: ce
|
||||
});
|
||||
}
|
||||
|
||||
const { ael, rel, ce } = getHelperFunctions();
|
||||
initialize({
|
||||
...config,
|
||||
_ael: ael,
|
||||
_rel: rel,
|
||||
_ce: ce
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user