ReactJS
1import React from "react";
2import './main.global.css'
3import {hot} from "react-hot-loader/root";
4import {Layout} from "./shared/Layout";
5import {Header} from "./shared/Header";
6import {Content} from "./shared/Content";
7import {CardList} from "./shared/CardList";
8import {useToken} from "./hooks/useToken";
9import {tokenContext} from "./shared/context/tokenContext";
10import {UserContextProvider} from "./shared/context/userContext";
11import {usePostsData} from "./hooks/usePostsData";
12import {PostsContextProvider} from "./shared/context/PostsContext";
13
14function AppComponent() {
15const [token] = useToken();
16usePostsData();
17return (
18<tokenContext.Provider value={token}>
19<UserContextProvider>
20<Layout>
21<Header/>
22<Content>
23<PostsContextProvider>
24<CardList/>
25</PostsContextProvider>
26</Content>
27</Layout>
28</UserContextProvider>
29</tokenContext.Provider>
30);
31}
32
33export const App = hot(() => <AppComponent/>);