Skip to content

An example on the draggable documentation contains an error with usage of useEffect #224

@TheMightyDev

Description

@TheMightyDev

In the documentation of draggable, under the conditional dragging section, there's an error with usage of useEffect :

useEffect receives a callback as first argument, so the following code (from the documentation) is incorrect:

  useEffect({
    // when disabled, don't make the element draggable
    // ...
   }, []);

This is correct:

-    useEffect({
+    useEffect(() => {
    // when disabled, don't make the element draggable
    // ...
  }, []);

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