UNPKG

@rbxts/react-hooks

Version:

Generated by [Rojo](https://github.com/rojo-rbx/rojo) 7.4.0.

22 lines (21 loc) 1 kB
/// <reference types="@rbxts/types" /> /// <reference types="@rbxts/compiler-types" /> export interface RenderInfo { readonly name: string; readonly renders: number; readonly sinceLastRender: number; readonly timestamp: number; } /** * If you want to monitor and log how a component renders, you can use * the `useRenderInfo` hook. This hook records the render count, the * time difference between renders, and the current render timestamp. * This hook is especially useful for development purposes, as it helps * developers understand how a component behaves in terms of rendering, * and allows them to improve performance and detect potential problems. * * @param name The name of the component you are monitoring. * @param logFunction The function to use for logging. Defaults to `print`. * @param logEnabled Whether or not logging is enabled. */ export declare function useRenderInfo(name?: string, logFunction?: typeof print, logEnabled?: boolean): Readonly<RenderInfo>;