2017-06-08_509bba0/509bba0_unpacked_with_node_modules/~/react-router/lib/RouteContext.js
2022-07-26 10:06:20 -07:00

52 lines
No EOL
1.3 KiB
JavaScript
Executable file

'use strict';
exports.__esModule = true;
var _routerWarning = require('./routerWarning');
var _routerWarning2 = _interopRequireDefault(_routerWarning);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var object = _react2.default.PropTypes.object;
/**
* The RouteContext mixin provides a convenient way for route
* components to set the route in context. This is needed for
* routes that render elements that want to use the Lifecycle
* mixin to prevent transitions.
*/
var RouteContext = {
propTypes: {
route: object.isRequired
},
childContextTypes: {
route: object.isRequired
},
getChildContext: function getChildContext() {
return {
route: this.props.route
};
},
componentWillMount: function componentWillMount() {
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(false, 'The `RouteContext` mixin is deprecated. You can provide `this.props.route` on context with your own `contextTypes`. http://tiny.cc/router-routecontextmixin') : void 0;
}
};
exports.default = RouteContext;
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-router/lib/RouteContext.js
// module id = 2776
// module chunks = 4