question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading bar is not displayed?

See original GitHub issue

Hi,

I know this question has been asked a lot in the past, but somehow I am not able to display the progress bar.

When I look at the page, I can’t find a snippet in the form:

<div style="width: 0%; transition: width 400ms ease-out, height 400ms linear, opacity 400ms ease-out; opacity: 0; height: 3px; background-color: red; position: absolute;"></div><div style="display: table; clear: both;"></div>

I use Thunk Middleware.

Component with <LoadingBar />

export class Header extends Component {
    static propTypes = {
        auth: PropTypes.object.isRequired,
        logout: PropTypes.func.isRequired,
        profile:PropTypes.object.isRequired
    };



    render() {
        const { isAuthenticated, user } = this.props.auth;
        const {isFetching, profile} = this.props.profile;

        const authLinks = (
            <ul className="navbar-nav justify-content-end">
        <span className="navbar-text mr-3">
          <strong>{user ? <Link to={"/profile/"+ (!isFetching? profile[0].id : null)}>{user.username}</Link> : null}</strong>
        </span>
                <li className="nav-item">
                    <Link className="nav-link abtn" to="/add_story">Add Story </Link> </li>
                <div className="headertest"><li className="float:right-align nav-item"><button onClick={this.props.logout} className="nav-link btn btn-info btn-sm text-light">Logout</button>  </li></div>
                
            </ul>
        );

        const guestLinks = (

             <div className="collapse navbar-collapse w-100" id="navbarSupportedContent">
                <ul className="navbar-nav w-100 justify-content-end " >
                    <li className="nav-item" >
                        <Link className="nav-link abtn" to="/register"   style={{color: '#ffffff'}}>Register <span className="sr-only">(current)</span></Link>
                    </li>
                    <li className="nav-item">
                        <Link className="nav-link abtn" to="/login"   style={{color: '#ffffff'}}>Login</Link>
                    </li>
                </ul>
            </div>

        );

        return (
            <nav className="navbar navbar-expand-md navbar-light fixed-top"
                 style={{backgroundColor: '#F16852'
                 }} expand="lg">
                <a className="navbar-brand" href="/" id="smallLinkButton"><img
                    id="smallLinkButton"
                    src="suyuh.png"
                    width="110"
                    height="42"
                    className="d-inline-block align-top"
                    alt="logo"
                /></a>

                <button className="navbar-toggler" type="button" data-toggle="collapse"
                        data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
                        aria-expanded="false" aria-label="Toggle navigation">
                    <span className="navbar-toggler-icon "></span>
                </button>
                {isAuthenticated  ? authLinks : guestLinks}
                <LoadingBar />
            </nav>
            
                

        );
    }
}

function mapStateToProps(state, ownProps) {
    const auth = state.auth
    const profile = state.profile



  return { auth, profile }
};

export default connect(
    mapStateToProps,
    { logout }
)(Header);

Installed reducer at the store:

import { combineReducers } from "redux";
import story from "./story";
import place from "./place";
import auth from "./auth";
import profile from "./profile";
import messages from "./messages";
import errors from "./errors";
import { loadingBarReducer } from 'react-redux-loading-bar'




export default combineReducers({
	story,
	place,
	profile,
	auth,
	errors,
	messages,
	loadingBar: loadingBarReducer,
});

Example action were i dispatch showLoading():

// GET STORY
export const getStory = () => (dispatch, getState) => {
  dispatch ({type: GET_STORY_REQUEST});
  dispatch(showLoading());
  axios.get( apiBase + "/story/retrieve/", tokenConfig(getState))
    .then(res => {
      dispatch({
        type: GET_STORY_SUCCESS,
        payload: res.data
      });
      dispatch(hideLoading());
    })
  .catch(err =>{
      dispatch({
        payload: returnErrors(err.response.data, err.response.status),
        type: GET_STORY_FAILURE });
      dispatch(hideLoading());
    })
};

Capture

I’m happy for any clarification.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
mironovcommented, Sep 15, 2020

@ProIcons Just to double-check: how do you import LoadingBar?

import LoadingBar from 'react-redux-loading-bar' connects to Redux store automatically import { LoadingBar } from 'react-redux-loading-bar' does not connect to the Redux store, and thus won’t react to dispatched actions

0reactions
Dani-Boy92commented, Sep 28, 2020

Sorry for the late reponse. @mironov diagnosed the problem. There was an issue with the import. Thanks for your support. I will close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Android Progress bar not showing up - Stack Overflow
In the Activity/Fragment - at different points - based on the data becoming available - ie using a Cursor or from the Network,...
Read more >
Progress Bar not showing up #11014 - GitHub
I have been using VS code for a while now and all of a sudden the progress bar stops appearing. I am using...
Read more >
Progress Bar not showing on some Epics - Atlassian Community
Existing issues/tasks that are added to an existing epic through Link Issue or by clicking on the + show no progress bar after...
Read more >
Progress Bar Not Showing - Typeform Community
It appears the progress bar is blocked by the “Question Group” headers -- really lame, esp. since my form is entirely chunked into...
Read more >
Progress bar is not showing in Content Timeline widget.
I have installed the master addon for elementor. But when I add the timeline widget, the progress bar is not showing. When I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found