UNPKG

react-router-navigation-confirm

Version:

A collection of components to display a custom confirmation dialog on navigation. More flexible solution to prevent than default react-router 'Prompt'

18 lines 830 B
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import * as React from 'react'; import { HistoryListenerContext } from '../components/HistoryListener'; function withHistoryService(Component) { return function (props) { return (React.createElement(HistoryListenerContext.Consumer, null, function (value) { return React.createElement(Component, __assign({}, props, { historyService: value })); })); }; } export { withHistoryService, }; //# sourceMappingURL=with-history-listener-context.js.map