react-navi
Version:
A batteries-included router for react.
28 lines • 1.23 kB
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var NaviContext_1 = require("./NaviContext");
function useHistory() {
if (process.env.NODE_ENV !== 'production') {
console.warn("Deprecation Warning: \"useHistory()\" is deprecated. It will be removed in a future version.");
}
return React.useContext(NaviContext_1.NaviContext).navigation._history;
}
exports.useHistory = useHistory;
function History(props) {
React.useEffect(function () {
if (process.env.NODE_ENV !== 'production') {
console.warn("Deprecation Warning: \"<History>\" is deprecated. It will be removed in a future version.");
}
}, []);
return (React.createElement(NaviContext_1.NaviContext.Consumer, null, function (context) { return props.children(context.navigation._history); }));
}
exports.History = History;
//# sourceMappingURL=History.js.map