@devtron-labs/devtron-fe-common-lib 0.0.85-beta-1 → 0.0.86-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import { UsePromptProps } from './types';
2
+
3
+ /**
4
+ * Hook that shows a prompt when shouldPrompt is true and the user tries to leave the page through refresh
5
+ * Meant to be used alongside the Prompt component from react-router-dom
6
+ */
7
+ declare const usePrompt: ({ shouldPrompt }: UsePromptProps) => void;
8
+ export default usePrompt;
@@ -0,0 +1 @@
1
+ export { default as usePrompt } from './UsePrompt';
@@ -0,0 +1,6 @@
1
+ export interface UsePromptProps {
2
+ /**
3
+ * If true the prompt will be shown
4
+ */
5
+ shouldPrompt: boolean;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './UsePrompt';
@@ -5,3 +5,4 @@ export * from './types';
5
5
  export * from './Providers';
6
6
  export * from './constants';
7
7
  export * from './Store';
8
+ export * from './Hooks';