Skip to content

Call update on render when component is not in DOM #80

@dy

Description

@dy

I was playing around with nanocomponent and component-box as possible target solution for jsx compilation and stumbled upon an issue.
Sometimes we may expect updaing a component state by calling render, even when the component is not in the DOM, eg.

let menu = new Menu()

// these render calls do not incur update call
menu.render({ content: 'Home' })
menu.render({ content: ['A', 'B'] })

document.body.appendChild(menu.render())

Does it make any sense to invoke update even for detached components? We can imagine some components not dealing with DOM at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions