plane/web/core/hooks/use-url-hash.tsx
2024-06-11 14:39:52 +05:30

15 lines
290 B
TypeScript

import { useEffect, useState } from "react";
const useURLHash = () => {
const [hashValue, setHashValue] = useState<string>();
useEffect(() => {
const hash = window.location.hash?.split("#")[1];
setHashValue(hash);
}, []);
return hashValue;
};
export default useURLHash;