Can you help me with exception Unexpected key \"userName\" found in preloadedState argument passed to createStore. Expected to find one of the known reducer keys inste
import * as reducers from './reducers'
is a good technique to avoid having your core code depend on the various functionalities implementations.
In order to make it work, you have to specify the name of the reducer to be the same as your store key userName. This can be achieved this way:
In the index.js that sits in the reducers folder, do
export { userNameReducer as userName } from "./UserNameReducer"
export { otherReducer as other } from "./OtherReducer"
An other way would be to directly rename the exported reducer the same as the store key.