code: function root(tree, Component) {
    if (!isBaobabTree(tree))
      throw makeError(
        'baobab-react/higher-order.root: given tree is not a Baobab.',
        {target: tree}
      );
  
    if (typeof Component !== 'function')
      throw Error('baobab-react/higher-order.root: given target is not a valid React component.');
  
    const name = displayName(Component);
  
    const value = { tree };
  
    const ComposedComponent = class extends React.Component {
      // Render shim
      render() {
        return (
          <BaobabContext.Provider value={ value }>
            <Component {...this.props} />
          </BaobabContext.Provider>
        );
      }
    };
  
    ComposedComponent.displayName = 'Rooted' + name;
  
    return ComposedComponent;
  }
docs: Root component