Skip to content

Create issue: Fix synchronous setState in DesktopViewport.tsx causing… #36

@pravin-python

Description

@pravin-python

Description

Error: Calling setState synchronously within an effect can trigger cascading renders in src/core/device/DesktopViewport.tsx. This occurs because setState (either setIsTouch or setScale) is called synchronously in useEffect, which is not safe in React strict mode.

Suggested Refactor

Consider refactoring with useLayoutEffect or restructuring the logic to avoid synchronous setState after the component has mounted.

Impact

This issue is causing CI failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions