Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Null-elements are not allowed? #79

Open
dy opened this issue May 31, 2018 · 1 comment
Open

Null-elements are not allowed? #79

dy opened this issue May 31, 2018 · 1 comment

Comments

@dy
Copy link
Contributor

dy commented May 31, 2018

There are use-cases when it is not necessary to create an element for a component, for example, when we render WebGL/regl or canvas2d layers:

<canvas id="canvas">
<Grid canvas="#canvas" type="cartesian" />
<Plot canvas="#canvas" data={data} />
<Text canvas="#canvas" text="Test Plot" />

Would that be reasonable to disable strong assertion of instance.element property? Or not forcing render to return etch virtual-dom?

Faced this issue trying to make gl-component API compatible with etch.

@dy
Copy link
Contributor Author

dy commented May 31, 2018

The simplest trick is using this.element = document.createTextNode('') and passing etch.update(this, false) to ignore rerender.

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

No branches or pull requests

1 participant