forked from Flipboard/react-canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGroup.js
35 lines (26 loc) · 986 Bytes
/
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
'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 (rootID, transaction, 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;
},
unmountComponent: function () {
LayerMixin.unmountComponent.call(this);
this.unmountChildren();
}
});
module.exports = Group;