UNPKG

react-router

Version:

A complete routing library for React

29 lines (20 loc) 858 B
'use strict'; exports.__esModule = true; var _routerWarning = require('./routerWarning'); var _routerWarning2 = _interopRequireDefault(_routerWarning); var _InternalPropTypes = require('./InternalPropTypes'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * A mixin that adds the "history" instance variable to components. */ var History = { contextTypes: { history: _InternalPropTypes.history }, componentWillMount: function componentWillMount() { process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(false, 'the `History` mixin is deprecated, please access `context.router` with your own `contextTypes`. http://tiny.cc/router-historymixin') : void 0; this.history = this.context.history; } }; exports.default = History; module.exports = exports['default'];