Skip to content

Discussion: useEffect deps array #20493

Closed
@darklight9811

Description

@darklight9811

What is it

Since the hooks launch, I've been working with various teams and developers, and all of them, I repeat, ALL of them, seniors and juniors. Have been using useEffect "wrong" (considering what the react team intended). They all use the dependency array as an update array. There is no reason to keep hammering us, telling us that it is a dependency array if no one uses that way.

What I propose

Change linters and documentation to reflect the array as an update array, not as a dependency. Maybe add a third argument that should run as an actual dependency array, that does not trigger the code inside.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions