-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathLayer.js
More file actions
30 lines (23 loc) · 769 Bytes
/
Layer.js
File metadata and controls
30 lines (23 loc) · 769 Bytes
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
/** @jsx React.DOM */
"use strict";
var React = require('react');
var LayerMixin = require('./LayerMixin');
var Layer = React.createClass({
mixins: [LayerMixin],
propTypes: {
layer: React.PropTypes.component
},
render: function() {
// Extract out props used by this component.
// TODO: swap out to use ES6-7 spread operator when possible
// @see https://gist.github.com/sebmarkbage/a6e220b7097eb3c79ab7
// var {container, layer, ...props} = this.props;
// return <div {...props}>{this.props.children}</div>;
return this.transferPropsTo(<div container={null} layer={null}>{this.props.children}</div>);
},
renderLayer: function() {
return this.props.layer ?
this.props.layer : null;
}
});
module.exports = Layer;