Skip to content

Conversation

mhryshkin
Copy link

This PR resolves issue #516, addressing an error where components are not mounted when TransformComponent is rendered conditionally or delayed.

Changes:

  • Added a safeguard to handle cases where wrapperComponent or contentComponent are unavailable by returning default position values.
  • This ensures compatibility and flexibility when using TransformComponent at any depth within the React tree, regardless of its conditional rendering.

@mhryshkin mhryshkin requested a review from prc5 as a code owner December 8, 2024 17:08

if (!wrapperComponent || !contentComponent) {
throw new Error("Components are not mounted");
return {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this causes resetTransform to not work

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How exactly? I mean this change should affect anything only at first render time to prevent this component throwing an error in case of a delayed render of a children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Components are not mounted" error if TransformComponent render is delayed/conditional

2 participants