Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Trusov committed Oct 2, 2021
1 parent 72c488e commit 8ab6c43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ Use `maxLoadingTime` property if you want to limit loading time. Pages will swit
</Switch>
```

If you want to change LoadingContext globally you can pass `isLoading` property to the Switch. This way you don't need to add extra `loadingContext.done();` in your page components after fetching is done.
```js
import { useIsFetching } from 'react-query';
const isFetching = useIsFetching();

<Switch isLoading={isFetching}>
...
</Switch>
```

Call `topbar.config()` if you want to change topbar configuration. More info <a href="http://buunguyen.github.io/topbar/" target="_blank">here</a>.
```js
import { topbar } from "react-router-loading";
Expand Down

0 comments on commit 8ab6c43

Please # to comment.