react-router
Version:
A complete routing library for React.js
42 lines (26 loc) • 1.74 kB
JavaScript
;
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _Link = require('./Link');
var _Link2 = _interopRequireDefault(_Link);
/**
* An <IndexLink> is used to link to an <IndexRoute>.
*/
var IndexLink = (function (_Component) {
_inherits(IndexLink, _Component);
function IndexLink() {
_classCallCheck(this, IndexLink);
_Component.apply(this, arguments);
}
IndexLink.prototype.render = function render() {
return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true }));
};
return IndexLink;
})(_react.Component);
exports['default'] = IndexLink;
module.exports = exports['default'];