Clean up main element style on unmount in AuditsPage
Add cleanup function to the useEffect that sets position: relative on the main element, so the style is restored when the component unmounts. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -196,6 +196,11 @@ export default function AuditsPage(props: Props) {
|
|||||||
if (mainRef.current) {
|
if (mainRef.current) {
|
||||||
mainRef.current.style.position = "relative";
|
mainRef.current.style.position = "relative";
|
||||||
}
|
}
|
||||||
|
return () => {
|
||||||
|
if (mainRef.current) {
|
||||||
|
mainRef.current.style.position = "";
|
||||||
|
}
|
||||||
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user