Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REACT warns about unmounting non-mounted components #12

Closed
mkholt opened this issue Feb 23, 2022 · 2 comments · Fixed by #15
Closed

REACT warns about unmounting non-mounted components #12

mkholt opened this issue Feb 23, 2022 · 2 comments · Fixed by #15
Assignees
Labels
bug Something isn't working

Comments

@mkholt
Copy link
Owner

mkholt commented Feb 23, 2022

If the PCF component is a REACT component, and the destroy method calls unmount, when navigating away, e.g. through a link in the component, REACT will throw errors in the console.

This is most likely related to attempting to call destroy in the wrong context.

@mkholt mkholt added the bug Something isn't working label Feb 23, 2022
@mkholt mkholt self-assigned this Feb 23, 2022
@mkholt
Copy link
Owner Author

mkholt commented Mar 11, 2022

Giving it some thought, this is most likely caused by CRM keeping a reference to the original PCF class, and trying to unmount it after, but the app is previously unmounted.

Additionally, this would explain why the original version is loaded when hitting the refresh button on home view.

@mkholt
Copy link
Owner Author

mkholt commented Mar 14, 2022

The current structure also leads to errors when multiple PCFs are on the same form or page.
Since we store context in a global variable, we won't load the PCFs correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant