Začetni commit projekta rezervacije

This commit is contained in:
Mark Poljanšek committed 2025-04-23 20:19:33 +02:00
commit 328731b32f
56062 files changed
+2485242

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
export { default } from "./useControlled.js";
export * from "./useControlled.js";
+19
View File
@@ -0,0 +1,19 @@
export interface UseControlledProps<T = unknown> {
/**
* Holds the component value when it's controlled.
*/
controlled: T | undefined;
/**
* The default value when uncontrolled.
*/
default: T | undefined;
/**
* The component name displayed in warnings.
*/
name: string;
/**
* The name of the state variable displayed in warnings.
*/
state?: string;
}
export default function useControlled<T = unknown>(props: UseControlledProps<T>): [T, (newValue: T | ((prevValue: T) => T)) => void];