Skip to content

Commit 9dc5949

Browse files
committed
version: 0.3.26
1 parent ff54c9e commit 9dc5949

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
Lets you create loaders that contain multiple RTK queries.
88

9-
* [Live demo / Playground](https://codesandbox.io/s/rtk-query-loader-demo-42tubp)
10-
* [NPM](https://www.npmjs.com/package/@ryfylke-react/rtk-query-loader)
9+
- [Live demo / Playground](https://codesandbox.io/s/rtk-query-loader-demo-42tubp)
10+
- [NPM](https://www.npmjs.com/package/@ryfylke-react/rtk-query-loader)
1111

1212
## **Usage**
1313

@@ -116,7 +116,20 @@ Creates an argument for the queries function based on expected props. Useful whe
116116

117117
**onError**?: `(props: T, error: RTKError) => ReactElement`
118118

119-
**onFetching**?: `(props: T, renderBody: (() => ReactElement)) => ReactElement`
119+
**onFetching**?: `(props: T, Component: (() => ReactElement)) => ReactElement`
120+
121+
Make sure you call the second argument as a component, not a function:
122+
123+
```tsx
124+
{
125+
onFetching: (props, Component) => (
126+
<div className="relative-wrapper">
127+
<Component />
128+
<LoadingOverlay />
129+
</div>
130+
);
131+
}
132+
```
120133

121134
## withLoader
122135

@@ -255,4 +268,4 @@ type TestTwo = InferLoaderData<typeof extendedTwo>;
255268
// which is correct.
256269
```
257270

258-
> This is just a type mistake that will hopefully be fixed in the future. Both `extendedOne` and `extendedTwo` return the same format, but `extendedTwo` has the correct types.
271+
> This is just a type mistake that will hopefully be fixed in the future. Both `extendedOne` and `extendedTwo` return the same format, but `extendedTwo` has the correct types.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ryfylke-react/rtk-query-loader",
3-
"version": "0.3.25",
3+
"version": "0.3.26",
44
"description": "Lets you create loaders that contain multiple RTK queries.",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.js",

0 commit comments

Comments
 (0)