Closed vaibhavhrt closed 4 years ago
Work fine for me !
Simply do this in App.js
import { loadProgressBar } from 'axios-progress-bar';
import 'axios-progress-bar/dist/nprogress.css';
class App extends Component {
componentDidMount() {
loadProgressBar();
}
}
@vaibhavhrt What is your specific problem? Using an axios instance and the default config has worked well for me:
import axios from 'axios';
import { loadProgressBar } from 'axios-progress-bar'
const api = () => {
const httpConfig = {
baseURL: "localhost:12345"
};
const instance = axios.create(httpConfig);
loadProgressBar(null, instance);
return instance;
};
export default api;
Not sure what I'm doing wrong, But the progress bar loads only to 1/4th of the screen and disappears in my case.
The progressbar is not showing to me also. I have loaded with an instance, the css code is loaded on
and js is called after axios instance.create. Is just that? a css code and js call? who is creating the div/positioning? Any ideas?
I have tried multiple things but still can't get it to work with react. It would be nice if you can add a few examples in repo showing working examples in different cases.