UNPKG

407 BJavaScriptView Raw
1import * as React from 'react';
2import PreventRemoveContext from './PreventRemoveContext';
3export default function usePreventRemoveContext() {
4 const value = React.useContext(PreventRemoveContext);
5
6 if (value == null) {
7 throw new Error("Couldn't find the prevent remove context. Is your component inside NavigationContent?");
8 }
9
10 return value;
11}
12//# sourceMappingURL=usePreventRemoveContext.js.map
\No newline at end of file