Created
January 16, 2023 19:30
-
-
Save SahanAmarsha/cb23fbc34408eacc5764b462bc026139 to your computer and use it in GitHub Desktop.
Final index.tsx file after adding AuthProvider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { createRoot } from "react-dom/client"; | |
import CssBaseline from "@mui/material/CssBaseline"; | |
import { ThemeProvider } from "@mui/material/styles"; | |
import App from "./App"; | |
import theme from "./theme"; | |
// import aws amplify | |
import { Amplify } from "aws-amplify"; | |
import awsExports from "./aws-exports"; | |
import AuthProvider from "./contexts/AuthContext"; | |
const rootElement = document.getElementById("root"); | |
const root = createRoot(rootElement!); | |
// configure amplify | |
Amplify.configure(awsExports); | |
root.render( | |
<ThemeProvider theme={theme}> | |
<AuthProvider> | |
<CssBaseline /> | |
<App /> | |
</AuthProvider> | |
</ThemeProvider> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment