UNPKG

1.23 kBJavaScriptView Raw
1/**
2 * Copyright 2014-present, Facebook, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
8 *
9 */
10
11'use strict';
12
13var _assign = require('object-assign');
14
15var ReactReconciler = require('./ReactReconciler');
16
17var ReactSimpleEmptyComponent = function (placeholderElement, instantiate) {
18 this._currentElement = null;
19 this._renderedComponent = instantiate(placeholderElement);
20};
21_assign(ReactSimpleEmptyComponent.prototype, {
22 mountComponent: function (transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots
23 {
24 return ReactReconciler.mountComponent(this._renderedComponent, transaction, hostParent, hostContainerInfo, context, parentDebugID);
25 },
26 receiveComponent: function () {},
27 getHostNode: function () {
28 return ReactReconciler.getHostNode(this._renderedComponent);
29 },
30 unmountComponent: function () {
31 ReactReconciler.unmountComponent(this._renderedComponent);
32 this._renderedComponent = null;
33 }
34});
35
36module.exports = ReactSimpleEmptyComponent;
\No newline at end of file