File tree Expand file tree Collapse file tree 1 file changed +21
-17
lines changed
sites/svelte-5-preview/src/lib/Output Expand file tree Collapse file tree 1 file changed +21
-17
lines changed Original file line number Diff line number Diff line change 111111
112112 ${ styles}
113113
114- const styles = document.querySelectorAll('style[id^=svelte-]');
115-
116- let i = styles.length;
117- while (i--) styles[i].parentNode.removeChild(styles[i]);
118-
119- if (window.unmount) {
120- try {
121- window.unmount();
122- } catch (err) {
123- console.error(err);
114+ {
115+ const styles = document.querySelectorAll('style[id^=svelte-]');
116+
117+ let i = styles.length;
118+ while (i--) styles[i].parentNode.removeChild(styles[i]);
119+
120+ if (window.__unmount_previous) {
121+ try {
122+ window.__unmount_previous();
123+ } catch (err) {
124+ console.error(err);
125+ }
124126 }
125- }
126127
127- document.body.innerHTML = '';
128- window._svelteTransitionManager = null;
129-
130- const { mount, App } = ${ $bundle .client ? .code };
131- const [, destroy ] = mount (App, { target: document .body });
128+ document.body.innerHTML = '';
129+ window._svelteTransitionManager = null;
130+ }
132131
133- window .unmount = destroy;
132+ const __repl_exports = ${ $bundle .client ? .code };
133+ {
134+ const { mount , App } = __repl_exports;
135+ const [, destroy ] = mount (App, { target: document .body });
136+ window .__unmount_previous = destroy;
137+ }
134138 // # sourceURL=playground:output
135139 ` );
136140 error = null;
You can’t perform that action at this time.
0 commit comments