import ReactDOM from "react-dom/client";
import { Provider } from "react-redux";
import reportWebVitals from "./reportWebVitals";
import AppRouter from "./routers/AppRouter";
import "./App.css";
import configureStore from "./store/configureStore";
import { getBlogsToDatabase } from "./actions/blogAction";
import "./firebase/firebaseConfig";
const root = ReactDOM.createRoot(document.getElementById("root"));
const store = configureStore();
const result = (
<Provider store={store}>
<AppRouter />
</Provider>
);
root.render(<p>Loading...</p>);
store.dispatch(getBlogsToDatabase()).then(() => {
root.render(result);
});
I'm getting an error when using the promise construct I have seen in some posts that it could be a problem with the NPM version. Thanks in advance for the help.