mironov / react-redux-loading-bar

Loading Bar (aka Progress Bar) for Redux and React
https://mironov.github.io/react-redux-loading-bar/
MIT License
936 stars 93 forks source link

Usage without redux #91

Closed erkieh closed 5 years ago

erkieh commented 5 years ago

Would it be possible to use this without redux?

mironov commented 5 years ago

@erkieh Yes, you can import not connected component: import { LoadingBar } from 'react-redux-loading-bar'

And mount it the following way:

<header>
  <LoadingBar loading="1" />
</header>

Please note that you will need to pass loading prop > 0 to show Loading Bar and = 0 to hide it.

erkieh commented 5 years ago

I was hoping to use it without having redux in my project at all. The import still runs the script and tries to create a connected component.

mironov commented 5 years ago

@erkieh Well, redux is a peer dependency and will always be. If you don't use redux at all, you might want to choose another pure react library.