DEV Community

Discussion on: Introducing Isotope - statically-dynamic UI library!

Collapse
 
areknawo profile image
Arek Nawo

Thanks for feedback! Your error is that you assign the node created by span() method instead of the div() one. Span doesn't have any state and so, you've got null. Simply change the value of your variable, like this:

const node = view.div({
    state: { 
        color: "#aaa",
        change: false
    },
    styles: (node) => ({
        color: node.getState("color"),
    })
});
node.span("TEXT ONE");
node.on("click", () => {
    // ...
});
Collapse
 
ilovecharliemey profile image
GabrielFernandes.js

Thanks ! S2