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

Clean up the themed controls when unmounted #1172

Closed
wants to merge 1 commit into from

Conversation

hanbyul-here
Copy link
Collaborator

Description of Changes

Clean up ref when themed controls are unmounted

Notes & Questions About Changes

I kept seeing an error that 'cannot update unmounted root' from dev environment of Next instance. I think it is because our themed control doesn't clean up its ref when unmounted. (It happens when I revisit the page while navigating - does not happen on the first landing.)

Screenshot 2024-09-25 at 10 00 11 AM

But I do have some questions 🤔

Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit aca6f92
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/66f4181b1414c20008cedf1e
😎 Deploy Preview https://deploy-preview-1172--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hanbyul-here
Copy link
Collaborator Author

Oh interesting, this change breaks custom controls on E&A pages, with an error that 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. @dzole0311 just in case this is related to the ticket you assigned yourself (#1155

dzole0311 added a commit that referenced this pull request Oct 29, 2024
**Related Ticket:** #1155
#1172

Related Next.js PR:
NASA-IMPACT/next-veda-ui#7

### Description of Changes

- Fixed the map controls so that they work in the Next.js instance
- Resolve issue with the Analyses Message display
- Attempted to address the React mount error mentioned in
#1172

### Notes & Questions About Changes
_{Add additonal notes and outstanding questions here related to changes
in this pull request}_

### Validation / Testing
1. Verify that the AOI controls and Analyses Message work as expected in
both veda-ui and the Next.js instance
2. Verify that adding, deleting a single drawn area, or deleting all
drawn areas works without issues
3. Ensure that analyses execute as expected
@hanbyul-here hanbyul-here deleted the cleanup-themed-control branch January 22, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant