lib/preact.rb in isomorfeus-preact-23.6.0.rc3 vs lib/preact.rb in isomorfeus-preact-23.6.0.rc4

- old
+ new

@@ -1203,15 +1203,14 @@ key = nil ref = nil end if block_given? - pr = `self.render_buffer` - pr.JS.push([]) + `self.render_buffer.push([])` block_result = yield - c = pr.JS.pop() %x{ + const c = self.render_buffer.pop(); if (self["$is_renderable?"](block_result)) { c.push(block_result); } if (c.length > 0) { children = c; } } end @@ -1227,11 +1226,12 @@ end end def _render_element(component, props, &block) %x{ - let opr = Opal.Preact.render_buffer; - opr[opr.length-1].push(#{create_element(component, props, nil, &block)}); + const opr = self.render_buffer; + if (typeof block === 'function') self.$create_element.$$p = block.$to_proc(); + opr[opr.length-1].push(self.$create_element(component, props, nil)); } nil end def hydrate(vnode, container_node)