Skip to content

Commit 8ab6c43

Browse files
author
Victor Trusov
committed
Updated readme
1 parent 72c488e commit 8ab6c43

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ Use `maxLoadingTime` property if you want to limit loading time. Pages will swit
104104
</Switch>
105105
```
106106

107+
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.
108+
```js
109+
import { useIsFetching } from 'react-query';
110+
const isFetching = useIsFetching();
111+
112+
<Switch isLoading={isFetching}>
113+
...
114+
</Switch>
115+
```
116+
107117
Call `topbar.config()` if you want to change topbar configuration. More info <a href="http://buunguyen.github.io/topbar/" target="_blank">here</a>.
108118
```js
109119
import { topbar } from "react-router-loading";

0 commit comments

Comments
 (0)