Do we need to mount on the DOM?
See original GitHub issuecreateApp(...).mount
requires a real DOM element from what I can see - I’m not sure how VTU beta handled this, but I believe the default was NOT to mount on the dom, since we had an attachToDocument
option.
We are currently tightly coupled to the DOM - not ideal, but I think it’s fine for a pre alpha.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
"mount" vs "render"? - React Training
"Mounting" is when React "renders" the component for the first time and actually builds the initial DOM from those instructions. A "re-render" ...
Read more >What is "Mounting" in React js? - Stack Overflow
The mounting refers to attaching the React component instance to the DOM node which is necessary to do tree diffing/incremental render updates on...
Read more >Mounting components and asserting on the DOM
To test this, we need to mount the component into a DOM container and then look at the rendered query output. Before writing...
Read more >What does it mean for a component to be mounted in ReactJS
Mounting is the initial phase in which the instance of the component is created and inserted into the DOM. When the component gets...
Read more >Mounting React Components Explained - YouTube
What does it mean to Mount a Component in React? ... interacts with the DOM, and discussion about what it means to Mount...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Going to close this for now - we have a pretty good solution where we mount on an element on in the DOM as of this commit so we are not blowing up any potentially pre-existing state, which matches the VTU beta API.
If this turns out to be a problem (eg performance) we can look more deeply into how this was handled in Vue 2.
Did a quick check - seems that in Vue 2, mount could indeed work without an element to mount to.
https://github.com/vuejs/vue/blob/e1fbfac66403aa0df5cdae040a8edf2f219455ca/src/core/instance/lifecycle.js#L143