Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions 23-quiz/final/src/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
// Importing React library for creating components
import React from 'react';

// Importing ReactDOM to handle rendering React components to the DOM
import ReactDOM from 'react-dom/client';

// Importing the CSS file for styling the application
import './index.css';

// Importing the main App component
import App from './App';

// Importing AppProvider, which provides global context to the application
import { AppProvider } from './context';

// Creating a root DOM node where the React application will be rendered
const root = ReactDOM.createRoot(document.getElementById('root'));

// Rendering the React application to the root element
root.render(
<React.StrictMode>
<AppProvider>
<App />
<React.StrictMode> {/* Enables additional checks and warnings in development mode */}
<AppProvider> {/* Wrapping the App component with AppProvider to enable global state management */}
<App /> {/* Rendering the main App component */}
</AppProvider>
</React.StrictMode>
);