@teamkeel/client-react 0.368.3 → 0.369.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/readme.md +6 -4
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @teamkeel/client-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Create a fully typed `useKeel()` hook from a generated Keel client.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ npm i @teamkeel/client-react
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Create the `KeelProvider` and `useKeel` components by passing your generated APIClient into the `keel` function from this package.
|
|
14
14
|
|
|
15
15
|
N.B. [See here](https://docs.keel.so/apis/client) for documentation on generating a client
|
|
16
16
|
|
|
@@ -21,7 +21,9 @@ export const { KeelProvider, useKeel } = keel(APIClient);
|
|
|
21
21
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Wrap your app with the exported `KeelProvider`
|
|
24
|
+
Wrap your app with the exported `KeelProvider` and set the endpoint for you API.
|
|
25
|
+
|
|
26
|
+
The endpoint is the base URL + the api name (if you haven't manually set an API name this is `api`). This url can be found in the Keel web console or in the output of `keel run` in your terminal.
|
|
25
27
|
|
|
26
28
|
```tsx
|
|
27
29
|
|
|
@@ -31,7 +33,7 @@ Wrap your app with the exported `KeelProvider`
|
|
|
31
33
|
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
Now you can use the typed `useKeel` hook in any component within your app
|
|
36
|
+
Now you can use the typed `useKeel` hook in any component within your app. You can [read more here](https://docs.keel.so/apis/client) on how to use the client.
|
|
35
37
|
|
|
36
38
|
```ts
|
|
37
39
|
function MyComponent() {
|