Implemented the GroupProvider in the Root.jsx
This commit is contained in:
parent
447a373271
commit
495d18ae09
@ -3,16 +3,29 @@ import "./styles.sass";
|
||||
import Footer from "@/common/components/Footer";
|
||||
import {useOutlet} from "react-router";
|
||||
import Background from "@/common/components/Background";
|
||||
import {socket} from "@/common/utils/socket.js";
|
||||
import {useEffect} from "react";
|
||||
import {GroupProvider} from "@/common/contexts/GroupContext.jsx";
|
||||
|
||||
export const Root = () => {
|
||||
const outlet = useOutlet();
|
||||
|
||||
useEffect(() => {
|
||||
socket.connect();
|
||||
|
||||
return () => {
|
||||
socket.disconnect();
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="root">
|
||||
<Header />
|
||||
|
||||
<main>
|
||||
<GroupProvider>
|
||||
{outlet}
|
||||
</GroupProvider>
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
|
Loading…
x
Reference in New Issue
Block a user