Skip to content

Synchronous Unmount Issue in 'beyond-widgets' Package #3

@jircdev

Description

@jircdev

Problem:
When using the 'beyond-widgets' package to mount and unmount React components, we are encountering a synchronous unmount issue. The issue arises when attempting to unmount a React widget while React is already in the process of rendering. This situation can potentially lead to a race condition and disrupt the expected behavior of our application.

Expected Behavior:
We expect the 'beyond-widgets' package to handle component mounting and unmounting smoothly without causing synchronous unmount errors or race conditions.

Steps to Reproduce:
To reproduce this issue, follow these steps:

  1. Include the 'beyond-widgets' package in a React application.
  2. Use the package to mount and unmount a React widget.
  3. Observe the warning message in the console: "Warning: Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."

Additional Information:

  • We are using React as specified: import React from 'react'.
  • Our codebase follows TypeScript and ESM standards.
  • Components and objects are organized in independent files.
  • We are open to suggestions on how to resolve this issue, adhering to best coding practices and TypeScript-specific solutions.

Environment:

  • React version:
  • 'beyond-widgets' package version:
  • TypeScript version:
  • Browser/OS:

Screenshots/Code Snippets:
If applicable, include any relevant code snippets or screenshots that can help in diagnosing the issue.

Note:
Please provide guidance on how to address this issue in a TypeScript and ESM-compliant manner while following best coding practices and patterns specific to our technology stack. Your input on resolving this issue will be greatly appreciated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

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