yoshuawuyts / microcomponent

Smol event based component library
MIT License
35 stars 11 forks source link

what is the point of state? #9

Closed jwerle closed 7 years ago

jwerle commented 7 years ago

state doesn't seem to be used anywhere https://github.com/yoshuawuyts/microcomponent/blob/master/index.js#L19

nanocomponent doesn't make use of it either

f-mer commented 7 years ago

Referring to yoshuawuyts/nanocomponent#25 the intention of state is to keep track of the internal state of the component. Everything that can not be computed from the outer application state and passed through the props params of the render method can be stored there. For example you could keep track if the cursor is hovering over your component.