I wrote the code using a youtube video tutorial. I also wrote the same code written in the video tutorial on my computer, but the result was not good. The problem is that I am using redux to add an api file. If I connect index.js and store as follows, it gives me an error.
Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at Object.injectEndpoints (http://localhost:3000/static/js/bundle.js:66563:36)
at baseCreateApi (http://localhost:3000/static/js/bundle.js:66581:16)
at ./src/reducer/emehmonApi.js (http://localhost:3000/static/js/bundle.js:7038:85)
at options.factory (http://localhost:3000/static/js/bundle.js:189281:31)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:188687:33)
at fn (http://localhost:3000/static/js/bundle.js:188938:21)
at ./src/reducer/index.js (http://localhost:3000/static/js/bundle.js:7105:69)
at options.factory (http://localhost:3000/static/js/bundle.js:189281:31)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:188687:33)
import React, { Suspense } from "react";
import ReactDOM from "react-dom";
import App from "./App";
import { BrowserRouter, HashRouter } from "react-router-dom";
import Spinner from "./views/Spinner/Spinner";
import "./style.scss";
import { Provider } from "react-redux";
import store from "./reducer";
ReactDOM.render(
<BrowserRouter>
<Suspense fallback={<Spinner />}>
<HashRouter>
<Provider store={store}>
<App />
</Provider>
</HashRouter>
</Suspense>
</BrowserRouter>,
document.getElementById("root")
);