decord/source/1595_usePreventRemoveContext.js

23 lines
677 B
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1595
// Function ID: 1596
2026-08-06 08:05:19 +00:00
// Name: usePreventRemoveContext
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 1570]
2026-08-06 08:05:19 +00:00
// Exports: usePreventRemoveContext
2026-08-15 05:55:55 +00:00
// Module 1595 (usePreventRemoveContext)
2026-08-24 06:08:38 +00:00
import PreventRemoveContext from "PreventRemoveContext" /* 1570 */;
import closure_2 from "noop" /* 19 */;
2026-08-06 08:05:19 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-08-06 08:05:19 +00:00
export const usePreventRemoveContext = function usePreventRemoveContext() {
2026-08-24 06:08:38 +00:00
const context = React.useContext(PreventRemoveContext.PreventRemoveContext);
2026-08-06 08:05:19 +00:00
if (null == context) {
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("Couldn't find the prevent remove context. Is your component inside NavigationContent?");
2026-08-06 08:05:19 +00:00
throw error;
} else {
return context;
}
};