Skip to content

Commit

Permalink
Redux ToolkitでStoreを作成してみよう
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yoshiii committed Aug 31, 2022
1 parent e9abab3 commit ac601c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/index.js
@@ -1,17 +1,15 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import { store } from "./store";
import { Provider } from "react-redux";

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

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
5 changes: 5 additions & 0 deletions src/store.js
@@ -0,0 +1,5 @@
import { configureStore } from "@reduxjs/toolkit";

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

0 comments on commit ac601c3

Please sign in to comment.