Skip to content

useRenderInfo

Hook for getting information about component rerender

debug
low
test coverage
Last changed: 7 months ago

Installation

Library
CLI
Manual
typescript
import { useRenderInfo } from '@siberiacancode/reactuse';

Usage

typescript
const rerenderInfo = useRenderInfo('Component');

Demo

Api

Parameters

NameTypeDefaultNote
name?string'Unknown'Component name
log?booleantrueToggle logging

Returns

UseRenderInfoReturn

Type declaration

typescript
export interface UseRenderInfoReturn {
  /** The name of the component */
  component: string;
  /** The number of renders */
  renders: number;
  /** The time since the last render */
  sinceLast: number;
  /** The timestamp of the render */
  timestamp: number | null;
}

Source

SourceDemo

Contributors

D
debabin
debabin
H
hywax
hywax
G
Gorilla Dev
Gorilla Dev

Released under the MIT License.