-
Notifications
You must be signed in to change notification settings - Fork 923
/
Group.js
41 lines (32 loc) · 1.04 KB
/
Group.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
var createComponent = require('./createComponent');
var ContainerMixin = require('./ContainerMixin');
var LayerMixin = require('./LayerMixin');
var RenderLayer = require('./RenderLayer');
var Group = createComponent('Group', LayerMixin, ContainerMixin, {
mountComponent: function (
transaction,
nativeParent,
nativeContainerInfo,
context
) {
var props = this._currentElement.props;
var layer = this.node;
this.applyLayerProps({}, props);
this.mountAndInjectChildren(props.children, transaction, context);
return layer;
},
receiveComponent: function (nextComponent, transaction, context) {
var props = nextComponent.props;
var prevProps = this._currentElement.props;
this.applyLayerProps(prevProps, props);
this.updateChildren(props.children, transaction, context);
this._currentElement = nextComponent;
this.node.invalidateLayout();
},
unmountComponent: function () {
LayerMixin.unmountComponent.call(this);
this.unmountChildren();
}
});
module.exports = Group;