UNPKG

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