Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dy opened this issue Apr 22, 2018 · 0 comments
Open

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

dy opened this issue Apr 22, 2018 · 0 comments

Comments

@dy
Copy link

dy commented Apr 22, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant