Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Loading bar not working with redux-persist #97

Open
@nikhilracha

Description

I have implemented react-redux-loading-bar with

loadingBarMiddleware(
 {
 promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAILURE'],
 }

and it was working perfectly fine. But after implementing the redux-persist the loading bar is not visible anymore.

After redux-persist
store.js

function configureStore(initialState = {}) {
 const persistConfig = {
 key: 'root',
 storage,
 whitelist: ['auth', 'patients', 'tests', 'store', 'loadingBar'],
 }
 const persistedReducer = persistReducer(persistConfig, rootReducer)
 const store = createStore(persistedReducer, initialState, compose(
 applyMiddleware(thunk, loadingBarMiddleware(
 {
 promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAILURE'],
 }
 )),
 window.__REDUX_DEVTOOLS_EXTENSION__ && 
 window.__REDUX_DEVTOOLS_EXTENSION__()
 ));
 console.log("initialState", store.getState());
 const persistor = persistStore(store, null, () => {
 // if you want to get restoredState
 console.log("restoredState", store.getState());
 });
 return { store, persistor };
}
export default configureStore;

Header.js

function Header() {
 const { store, persistor } = configureStore();
 return (
 <header>
 <Provider store={store} >
 <PersistGate persistor={persistor}>
 <LoadingBar
 //loading={1}
 style={{ height: "1.5px", opacity: "1", zIndex: "100000" }}
 />
 </PersistGate >
 </Provider >

In the redux tool, I can see that reducers are firing but I cannot see the loading bar??
Any idea??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /