This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRef, useState } from 'react'; | |
/** | |
* This hook will opt your component (and all downstream components) into | |
* rerenders that occur on the interval specified. | |
* | |
* ⚠️ This may induce serious performance consequences, especially when | |
* choosing a shorter intervalDuration | |
* | |
* @param intervalDuration number (in ms), default to 1000ms |