@@ -2836,7 +2836,7 @@ export function createRoot() {
28362836}
28372837
28382838/**
2839- * Mounts a component to the given target and returns the exports and potentially the accessors (if compiled with `accessors: true`) of the component
2839+ * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component
28402840 *
28412841 * @template {Record<string, any>} Props
28422842 * @template {Record<string, any>} Exports
@@ -2860,7 +2860,7 @@ export function mount(component, options) {
28602860}
28612861
28622862/**
2863- * Hydrates a component on the given target and returns the exports and potentially the accessors (if compiled with `accessors: true`) of the component
2863+ * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component
28642864 *
28652865 * @template {Record<string, any>} Props
28662866 * @template {Record<string, any>} Exports
@@ -2932,7 +2932,7 @@ export function hydrate(component, options) {
29322932 * @template {Record<string, any>} Props
29332933 * @template {Record<string, any>} Exports
29342934 * @template {Record<string, any>} Events
2935- * @param {import('../../main/public.js').ComponentType<import('../../main/public.js').SvelteComponent<Props, Events>> } component
2935+ * @param {import('../../main/public.js').ComponentType<import('../../main/public.js').SvelteComponent<Props, Events>> } Component
29362936 * @param {{
29372937 * target: Node;
29382938 * anchor: null | Text;
@@ -2944,14 +2944,14 @@ export function hydrate(component, options) {
29442944 * }} options
29452945 * @returns {Exports }
29462946 */
2947- function _mount ( component , options ) {
2947+ function _mount ( Component , options ) {
29482948 const registered_events = new Set ( ) ;
29492949 const container = options . target ;
29502950 const block = create_root_block ( options . intro || false ) ;
29512951
29522952 /** @type {Exports } */
29532953 // @ts -expect-error will be defined because the render effect runs synchronously
2954- let accessors = undefined ;
2954+ let component = undefined ;
29552955
29562956 const effect = render_effect (
29572957 ( ) => {
@@ -2961,7 +2961,7 @@ function _mount(component, options) {
29612961 options . context ;
29622962 }
29632963 // @ts -expect-error the public typings are not what the actual function looks like
2964- accessors = component ( options . anchor , options . props || { } ) || { } ;
2964+ component = Component ( options . anchor , options . props || { } ) || { } ;
29652965 if ( options . context ) {
29662966 pop ( ) ;
29672967 }
@@ -3008,7 +3008,7 @@ function _mount(component, options) {
30083008 event_handle ( array_from ( all_registerd_events ) ) ;
30093009 root_event_handles . add ( event_handle ) ;
30103010
3011- mounted_components . set ( accessors , ( ) => {
3011+ mounted_components . set ( component , ( ) => {
30123012 for ( const event_name of registered_events ) {
30133013 container . removeEventListener ( event_name , bound_event_listener ) ;
30143014 }
@@ -3020,11 +3020,11 @@ function _mount(component, options) {
30203020 destroy_signal ( /** @type {import('./types.js').EffectSignal } */ ( block . e ) ) ;
30213021 } ) ;
30223022
3023- return accessors ;
3023+ return component ;
30243024}
30253025
30263026/**
3027- * References of the accessors of all components that were `mount`ed or `hydrate`d .
3027+ * References of the components that were mounted or hydrated .
30283028 * Uses a `WeakMap` to avoid memory leaks.
30293029 */
30303030let mounted_components = new WeakMap ( ) ;
@@ -3034,12 +3034,12 @@ let mounted_components = new WeakMap();
30343034 * @param {Record<string, any> } component
30353035 */
30363036export function unmount ( component ) {
3037- const destroy = mounted_components . get ( component ) ;
3038- if ( DEV && ! destroy ) {
3037+ const fn = mounted_components . get ( component ) ;
3038+ if ( DEV && ! fn ) {
30393039 // eslint-disable-next-line no-console
30403040 console . warn ( 'Tried to unmount a component that was not mounted.' ) ;
30413041 }
3042- destroy ?. ( ) ;
3042+ fn ?. ( ) ;
30433043}
30443044
30453045/**
0 commit comments