Skip to content

[Bug] Can't perform a React state update on an unmounted #335

@THIRUMALAIVASAN9245

Description

@THIRUMALAIVASAN9245
Image

Describe the bug

A React warning appears in the console: "Can't perform a React state update on an unmounted component." This indicates that a component continues updating state after it has already been unmounted, likely due to an async operation or subscription not being cleaned up.

Steps to Reproduce

Steps to Reproduce
Open the Dataverse Demo App code
Whenever I ran the app on the browser I got this warning error message on the console
Observe the browser console (Press F12 )

The warning appears during component unmount or navigation.

Expected behavior

Components should clean up all async operations, subscriptions, and event listeners before unmounting so that no state updates occur after the component is removed.
Zero error on the console page

Actual behavior

React logs the following warning:
This suggests missing cleanup logic in a useEffect hook or similar lifecycle pattern.

Screenshots or Error Messages
Code
Warning: Can't perform a React state update on an unmounted component.

Environment information

Framework/build tool: React (Power Apps Code Components host)

Browser: Chrome/Edge

Dataverse-connected component

Likely triggered by async fetch or subscription inside a component

Additional context

This issue may be caused by:

An async fetch call not being cancelled

A subscription or event listener not being removed in cleanup

A useEffect hook missing a return () => { ... } cleanup function

If you want, I can also generate a proposed fix section, including a sample cleanup pattern using AbortController or subscription teardown.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions