@rbxts/pretty-react-hooks
Version:
Useful hooks for @rbxts/react
13 lines (12 loc) • 487 B
TypeScript
/// <reference types="react" />
/**
* Returns the lifetime of the component in seconds. Updates every frame on
* the Heartbeat event.
*
* If the dependency array is provided, the lifetime timer will reset when
* any of the dependencies change.
*
* @param dependencies An optional array of dependencies to reset the timer.
* @returns A binding of the component's lifetime.
*/
export declare function useLifetime(dependencies?: unknown[]): import("@rbxts/react").Binding<number>;