2018-05-09 05:56:14 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "RootShadowNode.h"
|
2018-05-16 20:35:33 +00:00
|
|
|
|
2018-07-15 23:46:31 +00:00
|
|
|
#include <fabric/components/view/conversions.h>
|
2018-05-09 05:56:14 +00:00
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
2018-08-04 16:30:13 +00:00
|
|
|
const char RootComponentName[] = "RootView";
|
2018-05-09 05:56:14 +00:00
|
|
|
|
|
|
|
void RootShadowNode::layout() {
|
|
|
|
ensureUnsealed();
|
2018-05-14 22:43:28 +00:00
|
|
|
layout(getProps()->layoutContext);
|
2018-05-16 06:32:33 +00:00
|
|
|
|
|
|
|
// This is the rare place where shadow node must layout (set `layoutMetrics`)
|
|
|
|
// itself because there is no a parent node which usually should do it.
|
2018-05-22 22:45:55 +00:00
|
|
|
setLayoutMetrics(layoutMetricsFromYogaNode(yogaNode_));
|
2018-05-09 05:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace react
|
|
|
|
} // namespace facebook
|