Skip to content

Commit

Permalink
Add router & redux store to the application
Browse files Browse the repository at this point in the history
  • Loading branch information
hmunish committed Oct 30, 2023
1 parent d036d09 commit e423fe7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 33 deletions.
25 changes: 4 additions & 21 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
import logo from './logo.svg';
import './App.css';
import { Routes } from 'react-router-dom';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit
{' '}
<code>src/App.js</code>
{' '}
and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<main>
<Routes />
</main>
);
}

Expand Down
20 changes: 10 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import { BrowserRouter } from "react-router-dom";
import { Provider } from "react-redux";
import store from "./redux/store";
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import App from './App';
import reportWebVitals from './reportWebVitals';
import store from './redux/store';

const root = ReactDOM.createRoot(document.getElementById("root"));
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<BrowserRouter>
<Provider store={store}>
<App />
</Provider>
</BrowserRouter>
</React.StrictMode>
</React.StrictMode>,
);

// If you want to start measuring performance in your app, pass a function
Expand Down
4 changes: 2 additions & 2 deletions src/redux/store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { configureStore } from "@reduxjs/toolkit";
import { configureStore } from '@reduxjs/toolkit';

const store = configureStore({});
const store = configureStore({ reducer: {} });

export default store;

0 comments on commit e423fe7

Please sign in to comment.