3 ms·
It would be cool to summarize the kind of stuff you can or can't do with Riot vs React. I still don't get how state works, whether state changes propagate down
by danabramov 12y ago
It would be cool to summarize the kind of stuff you can or can't do with Riot vs React.
I still don't get how state works, whether state changes propagate down the components as prop changes like in React, etc.
- tipiirai 12y agoEach component maintains it's own state. Think them as functions with isolated scope. The tags accept arguments via HTML attributes and each tag has a reference to it's parent. Instance variables and method are assigned to the scope and you have direct access to them on the HTML expressions. Once the scope changes and tag's `update()` method is called the expressions are calculated and DOM nodes are updated. Nested children are also updated. You can update all tags at the same time with a global `riot.update()` method. Hope this helps.