Add risk creation form
Signed-off-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
committed by
Sacha Al Himdani
parent
15cf471454
commit
3d4ecf5f8f
@@ -1 +1,2 @@
|
||||
export { usePageTitle } from "./usePageTitle";
|
||||
export { useToggle } from "./useToggle";
|
||||
|
||||
7
packages/hooks/src/useToggle.tsx
Normal file
7
packages/hooks/src/useToggle.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { useCallback, useState } from "react";
|
||||
|
||||
export function useToggle(initialValue: boolean) {
|
||||
const [value, setValue] = useState(initialValue);
|
||||
const toggle = useCallback(() => setValue((prev) => !prev), []);
|
||||
return [value, toggle] as const;
|
||||
}
|
||||
Reference in New Issue
Block a user