React Hooks
    Preparing search index...

    Interface Counter

    Options for configuring the useCounter hook

    interface Counter {
        initialValue?: number;
        min?: number;
        max?: number;
        step?: number;
        onChange?: (value: number) => void;
    }
    Index

    Properties

    initialValue?: number

    Initial value of the counter

    0
    
    min?: number

    Minimum value the counter can reach

    max?: number

    Maximum value the counter can reach

    step?: number

    Step size for increment and decrement

    1
    
    onChange?: (value: number) => void

    Callback function that is called whenever the counter value changes

    Type Declaration

      • (value: number): void
      • Parameters

        • value: number

          The new counter value

        Returns void