Children appended to script element when using root: document.body
See original GitHub issueHi,
When I specify root: document.body
I get children of my component appended to the script
tag:
Code
View
const { h } = require('hyperapp')
const hyperx = require('hyperx')
const html = hyperx(h)
const ScheduleEvent = (event) => html`
<li class="schedule-event">
<span class="event">${event.title}</span>
<span class="hours">
<time>${event.start}</time> -
<time>${event.end}</time>
</span>
</li>
`
const ScheduleDay = (day) => html`
<li class="schedule-day">
<span class="day"></span>
<ul class="events">
${day.events.map(event => ScheduleEvent(event))}
</ul>
</li>
`
const ScheduleWidget = (schedule) => html`
<ul class="schedule-widget">
${schedule.days.map(day => ScheduleDay(day))}
</ul>
`
module.exports = ScheduleWidget
Index
const { app } = require('hyperapp')
const model = require('./lib/model')
const view = require('./lib/view')
const reducers = require('./lib/reducers')
const subscriptions = require('./lib/subscriptions')
app({ model, view, reducers, subscriptions, root: document.body })
Issue Analytics
- State:
- Created 7 years ago
- Comments:25 (21 by maintainers)
Top Results From Across the Web
Node.appendChild() - Web APIs - MDN Web Docs
The appendChild() method of the Node interface adds a node to the end of the list of children of a specified parent node....
Read more >JavaScript appendchild(): What it is and when to use it - Flexiple
The JavaScript appendChild() method is used to insert a new node or reposition an existing node as the last child of a particular...
Read more >javascript - How to target document.body.appendchild(' to root ...
Show activity on this post. parent to get window object of document where iframe is located, then get document and then actual DOM...
Read more >JavaScript appendChild() By Practical Examples
In this tutorial, you will learn how to use the JavaScript appendChild() method to add a node to the end ... The appendChild()...
Read more >Children appended to shadow root of custom element does ...
The issue is that children (style element in this case) appended to shadow root of custom element does not get onload event fired....
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 Free
Top 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
Fixed. 🤣
@jbucaran Couldn’t it be related to the hardcoded
0
atapp.js:L:116 patch(root, node, node = view(model, actions), 0)
?