crysalead-js / dom-layer

Virtual DOM implementation.
MIT License
30 stars 1 forks source link

component example not working #55

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi. Long time. Just for fun did I try your component example in the readme on the frontpage. Have you tried it? It's not working after what I can see. I tried with newest updated version. It throw's render is not a function from the create function. If I workaround that, I will get this TypeError: fromStartNode.match is not a function

jails commented 9 years ago

Which example ?

ghost commented 9 years ago

https://github.com/crysalead-js/dom-layer#example-1 And try the Component example

jails commented 9 years ago

It would be a lot time saver for me if you can provide some code instead, because for me everything works fine. https://jsfiddle.net/4ddq55ho/ https://jsfiddle.net/rpgkw00n/

ghost commented 9 years ago

@jails JsFiddle from now. I figure it out. It was not mounted. As in REACT, they seem to check if the node are mounted before an update etc. Maybe add an check if it's mounted or a domLayer element? I can't see no validation of the container or the data in mount().

jails commented 9 years ago

Not sure to get what you mean, the update() method take the mountId returned by mount() and if you provide an invalid mountId the update() method it just bails out.