bredele / grout

:sweat_drops: virtual dom
MIT License
3 stars 0 forks source link

use id as unique ref #10

Open bredele opened 9 years ago

bredele commented 9 years ago

An id should be declared once. It does not make any sense to interpolate it and we could use it as a uniq ref.


var comp = dom('ul', [
  dom('li'. {
    id: 'item'
  });
]);

comp.item;
// => <li id="item"></li>
bredele commented 9 years ago

we could also use the ref keyword like react:

var comp = dom('ul', [
  dom('li'. {
    ref: 'item'
  });
]);