261116_01_ENH: 색상 선택 컴포넌트(kri-color-palette) 추가 및 선택적 투명도 지원
This commit is contained in:
8
registry/components/color-palette/use-ref-with-init.ts
Normal file
8
registry/components/color-palette/use-ref-with-init.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as React from "react";
|
||||
|
||||
function useRefWithInit<T>(init: () => T): React.RefObject<T> {
|
||||
const [ref] = React.useState(() => ({ current: init() }));
|
||||
return ref;
|
||||
}
|
||||
|
||||
export { useRefWithInit };
|
||||
Reference in New Issue
Block a user