Skip to content

[bug]: animated-grid-pattern unusable #854

@120MF

Description

@120MF

Describe the bug

the animated-grid-pattern component can't see any animation effect now. and it will cause the page crash after seconds. see #838

you can catch error in console:

installHook.js:1 Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

which comes from the components tsx:

  // Update squares to animate in
  useEffect(() => {
    if (dimensions.width && dimensions.height) {
      setSquares(generateSquares(numSquares))
    }
  }, [dimensions, numSquares, generateSquares])

Affected component/components

Animated Grid Pattern

How to reproduce

Introduce it to your code
see the error in console

Codesandbox/StackBlitz link

No response

Logs

installHook.js:1 Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

which comes from the components tsx:

  // Update squares to animate in
  useEffect(() => {
    if (dimensions.width && dimensions.height) {
      setSquares(generateSquares(numSquares))
    }
  }, [dimensions, numSquares, generateSquares])

System Info

Linux Fedora 42
Chrome

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions