mount
Inserting a component's elements into the live page; unmounting removes them again.
In more detail
Frameworks call this step mounting; in plain DOM code it is simply inserting a component's root element. Whatever a component sets up when it mounts, such as observers, listeners and timers, should be torn down when it unmounts, or those references keep memory alive.
Related terms
- component — A reusable, self-contained piece of interface, such as a card or a modal, with its own markup, styles and behaviour.
- memory leak — Memory that a program keeps holding although it no longer needs it, so usage grows until the program slows down or crashes.
- MutationObserver — A browser object that watches part of the DOM and reports changes, such as added nodes or changed attributes, in batches.
Taught in
- DOM Manipulation: DocumentFragment And HTML Templates — Frontend Architecture & Web Platform
- MutationObserver: Reactive DOM Watching Without Polling — Frontend Architecture & Web Platform
- Memory Management: Garbage Collection, Memory Leaks And WeakMap — Frontend Architecture & Web Platform