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: handle sonarqube warnings alpha (and one plugin thing) #898

Merged
merged 9 commits into from
Dec 10, 2024
Prev Previous commit
Next Next commit
fix(plugin): remove resize observer on cleanup
  • Loading branch information
KaiVandivier committed Dec 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 90cd1491269c313c2f6062ffe11a53e65c48ae2c
4 changes: 4 additions & 0 deletions shell/src/PluginLoader.jsx
Original file line number Diff line number Diff line change
@@ -20,6 +20,10 @@
resizePluginHeight(divRef.current.offsetHeight + 20)
})
resizeObserver.observe(divRef.current)
return () => {
resizeObserver.unobserve(divRef.current);

Check warning on line 24 in shell/src/PluginLoader.jsx

GitHub Actions / lint

The ref value 'divRef.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'divRef.current' to a variable inside the effect, and use that variable in the cleanup function
resizeObserver.disconnect();
};
}
}, [resizePluginHeight])

Loading