mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(react): setupIonicReact no longer crashes in SSR environment (#24604)
This commit is contained in:
@ -197,7 +197,9 @@ export const setupIonicReact = (config: IonicConfig = {}) => {
|
||||
* TODO: Remove when all integrations have been
|
||||
* migrated to CE build.
|
||||
*/
|
||||
if (typeof (document as any) !== 'undefined') {
|
||||
document.documentElement.classList.add('ion-ce');
|
||||
}
|
||||
|
||||
initialize({
|
||||
...config
|
||||
|
@ -21,8 +21,6 @@ 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
|
||||
@ -30,7 +28,9 @@ export const IonicVue: Plugin = {
|
||||
* 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({
|
||||
@ -40,5 +40,4 @@ export const IonicVue: Plugin = {
|
||||
_ce: ce
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user