Skip to content

Allow passing no dependency list to useDebouncedEffect, useThrottledEffect, etc. #1668

@benface

Description

@benface

New Features

What is the new or updated feature that you are suggesting?

The second argument of useDebouncedEffect, useThrottledEffect, etc. is DependencyList which only accepts an array, but it should also accept null or undefined when the effect should intentionally run every render (well, potentially run every render and potentially after a delay, given the debounced/throttled nature).

Why should this feature be included?

Because React's own useEffect and useLayoutEffect support it, and it can be quite useful!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions