@saber2pr/router
Version:
> react-router-dom by hooks api.
17 lines (16 loc) • 454 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @Author: saber2pr
* @Date: 2019-06-04 15:01:38
* @Last Modified by: saber2pr
* @Last Modified time: 2019-06-06 15:00:18
*/
var react_1 = require("react");
var context_1 = require("../context");
exports.useHistory = function (history) {
var Ctx = react_1.useContext(context_1.HistoryCtx);
if (history)
Ctx.history = history;
return Ctx.history;
};