We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf1f452 commit 4eafc24Copy full SHA for 4eafc24
src/reactUtils.js
@@ -60,6 +60,11 @@ export function useDebugAssertConstant<T>(value: T) {
60
*
61
* The caller must use a constant `duration` through the lifetime of a given
62
* component instance.
63
+ *
64
+ * Note this hook doesn't (and can't) do anything to cause a rerender when
65
+ * `value` changes. The caller must ensure that the component rerenders (so
66
+ * that in particular this hook gets called again) whenever `value` will
67
+ * have changed; for example, by using a prop or a `useState` value.
68
*/
69
export const useHasStayedTrueForMs = (value: boolean, duration: number): boolean => {
70
useDebugAssertConstant(duration);
0 commit comments