React interval hook
  • Introduction
  • Installation
  • Basics
  • Advanced
    • Definition
    • Callback
    • Interval
    • Options
      • Configuration
        • Auto start
        • Immediate callback call
        • Self correction
      • Callbacks
        • On finish
    • Hook result / Controls
      • Start
      • Stop
      • Is active
  • Examples
    • Advanced usage
    • Live demo
      • Version 1
  • Migration
    • Change log
Powered by GitBook
On this page

Was this helpful?

  1. Advanced
  2. Hook result / Controls

Stop

PreviousStartNextIs active

Last updated 1 year ago

Was this helpful?

Name

stop

Type

(triggerFinishCallback?: boolean) => void

Description

Stops timer (not pause) after it was started using either option or method.

This will reset current , so if for example interval was set to 1000ms and stop method was called after 400ms, starting it again will trigger next callback after 1000ms, not 600ms.

By default calling stop will trigger , unless called with triggerFinishCallback equal to false like stop(false).

autoStart
start
interval
finish callback