Can’t create Store
, gives an error (see Screenshots) .
index.js file
import store from './redux/store-redux';
Import ReactDom from 'React-Dom';
Import './index.css';
Import app from './app';
Let Renderpage = (State) = & gt; {
Reactdom.render (
& lt; react.strictmode & gt;
& lt; app Store = {Store}
pageMessages = {state.pageMessages}
PostSData = {state.pageProfile.postsdata}
PostValue = {state.pageProfile.postvalue}
dispatch = {store.dispatch.bind (Store)} / & gt;
& lt; /react.strictmode>
Document.GetElementByid ('root')
);
}
RENDERPAGE (Store.getState ());
Store.Subscribe (() = & gt; {
Let State = Store.getState ();
RENDERPAGE (STATE);
});
Store-Redux File
import {combinereducers, createstore} from "redux";
Import MessagesRducer from "../Reducers/PageMessagesReducer";
Import ProfileRecer from "../Reducers/PageProfileReDucer";
Let ReduCers = CombinereduCers ({
PageMessages: MessagesReducer,
PageProfile: ProfileRecer.
});
Let Store = CreateStore (ReduCers);
Window.Store = Store;
EXPORT DEFAULT STORE;
Answer 1
There are so many options why this can happen.
- you have react.strictmode described, but nowhere is not described by the import of the reaction (if it is done globally, then the problem is not in this)
- can influence the Store-Redux file extension if it is a JS file, then the problem is not in this
- can affect the left library (which is unlikely) Link
In general, your code worker Example
Probably problem in WebPack or import settings.