render()

in 04 - Layout/02 - Layout Components.js [22:39]


  render() {
    var children = this.prerendered;
    var positionedChildren = [];
    var y = 0;
    for (var i = 0; i < children.length; i++) {
      // This child is an opaque black box whose props cannot be inspected,
      // nor cloned. It can only be rendered once. Rendering it twice results
      // in a conflict, at least until we support painting the same stateful
      // component in many different places (e.g. SVG's <use />)
      var child = children[i];
      positionedChildren.push(
        <Positioner key={child.key} x={0} y={y}>{child}</Positioner>
      );
      // We can use it to inspect the child's reverse context though.
      y += child.result.layoutHeight;
    }
    return <Fragment>{positionedChildren}</Fragment>;
  }