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

fix(ui): safe call within useEffect teardown #11135

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

GeorgeHulpoi
Copy link
Contributor

NavProvider useEffects teardown is trying to set style on an element that may not exist. The original code produces the following error:

image
image

Therefore, a condition has been added to check if navRef.current is truthy.

@paulpopus paulpopus enabled auto-merge (squash) February 12, 2025 15:17
@paulpopus paulpopus merged commit 30c77d8 into payloadcms:main Feb 12, 2025
72 checks passed
jacobsfletch pushed a commit that referenced this pull request Feb 17, 2025
`NavProvider` useEffects teardown is trying to set `style` on an element
that may not exist. The original code produces the following error:


![image](https://github.com/user-attachments/assets/11a83fbe-67eb-42a9-bd78-749ea98b67c5)

![image](https://github.com/user-attachments/assets/28ed2534-2387-416b-8191-d68b478161aa)

Therefore, a condition has been added to check if `navRef.current` is
truthy.
kendelljoseph pushed a commit that referenced this pull request Feb 21, 2025
`NavProvider` useEffects teardown is trying to set `style` on an element
that may not exist. The original code produces the following error:


![image](https://github.com/user-attachments/assets/11a83fbe-67eb-42a9-bd78-749ea98b67c5)

![image](https://github.com/user-attachments/assets/28ed2534-2387-416b-8191-d68b478161aa)

Therefore, a condition has been added to check if `navRef.current` is
truthy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants