UNPKG

769 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _react = require('react');
8
9var _react2 = _interopRequireDefault(_react);
10
11function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
13var TabContent = function TabContent(_ref, context) {
14 var children = _ref.children;
15 return _react2.default.createElement(
16 'div',
17 null,
18 _react.Children.map(children, function (child, key) {
19 return (0, _react.cloneElement)(child, {
20 key: key,
21 active: context.currentTab === key
22 });
23 })
24 );
25};
26
27TabContent.propTypes = {
28 children: _react.PropTypes.node.isRequired
29};
30
31TabContent.contextTypes = {
32 currentTab: _react.PropTypes.number
33};
34
35exports.default = TabContent;
\No newline at end of file