Skip to content

[Bug]: Coachmark creates an infinite React render loop #26933

@spmonahan

Description

@spmonahan

Library

React / v8 (@fluentui/react)

System Info

n/a

Are you reporting Accessibility issue?

no

Reproduction

https://codesandbox.io/s/infinite-loop-0n4cy4?file=/src/index.tsx

Bug Description

Actual Behavior

Coachmark continually re-renders due to the setBounds() call in requestAnimationFrame. This PR is has the change that lead to this issue.

The issue is that getBounds() returns a new object on every call so setBounds() triggers a re-render on every frame.

Expected Behavior

Coachmark does not continually re-render.

Logs

No response

Requested priority

Blocking

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions