@contentful/react-apps-toolkit 0.5.1 → 0.5.2
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/README.md +20 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,26 @@ yarn add @contentful/react-apps-toolkit
|
|
|
18
18
|
|
|
19
19
|
## Available features
|
|
20
20
|
|
|
21
|
-
The following hooks and utilities are exported from the package:
|
|
21
|
+
The following hooks and utilities are exported from the package:
|
|
22
|
+
|
|
23
|
+
### `useSDK`
|
|
24
|
+
|
|
25
|
+
This hook returns the App SDK.
|
|
26
|
+
|
|
27
|
+
The only requirement for using it is that the component that uses it is wrapped within the `SDKProvider`.
|
|
28
|
+
If it is not, the hook will throw an error.
|
|
29
|
+
|
|
30
|
+
Here is an example of how you can use it:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
function App() {
|
|
34
|
+
const sdk = useSDK<FieldExtensionSDK>();
|
|
35
|
+
|
|
36
|
+
return <>App Id: {sdk.ids.app}</>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
|
|
22
41
|
|
|
23
42
|
#### SDKProvider
|
|
24
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/react-apps-toolkit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Toolkit for building a Contentful app in React",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Contentful GmbH",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"@contentful/app-sdk": "^4.0.0",
|
|
51
51
|
"contentful-management": ">=7.30.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "174ac57f86e1e9bde1594fa444ba1fd59f5ebe91"
|
|
54
54
|
}
|