mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-02 21:14:15 +01:00
Split codebase (#455)
This commit is contained in:
1 parent
d2dc719cc6
commit
10559c8f4f
742 files changed
+7686
-3249
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import { useCallback, useState } from "react";
|
||||
import { generateId } from "../lib/generateId";
|
||||
|
||||
export function useRandomKey(initialValue?: string) {
|
||||
const [value, setValue] = useState<string>(initialValue ?? generateId());
|
||||
const regenerate = useCallback(() => setValue(generateId()), []);
|
||||
return [value, regenerate] as const;
|
||||
}
|
||||
Reference in new issue
Block a user