You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Ditto textId={textId} variables={{ numItems:1 }}count={1}/>// The cart contains 1 item
115
+
<Ditto textId={textId} variables={{ numItems:1 }}count={1}/>// The cart contains 1 item
116
116
<Ditto textId={textId} variables={{ numItems:0 }} count={0}/>// The cart contains no items
117
117
```
118
118
@@ -224,7 +224,7 @@ If you pass `frameId` and/or `blockId`, the specified frame/block object will be
224
224
</Ditto>
225
225
```
226
226
227
-
### Note
227
+
### Type-specific component exports
228
228
229
229
In addition to the `<Ditto />` component, individual exports of each specific component type are also available. These behave identically to passing the respective prop configurations to the `<Ditto />` component, but may provide a better experience for TypeScript users due to their improved out-of-the-box type safety and inference:
230
230
@@ -237,6 +237,19 @@ import {
237
237
} from"ditto-react";
238
238
```
239
239
240
+
### Hooks (experimental)
241
+
242
+
Hooks are also available for consuming data from a `<DittoProvider />`. The two hooks currently exposed have unpolished ergonomics due to the manner in which they evolved from legacy constraints.
243
+
244
+
In future versions of `ditto-react`, a hooks-based API will be the primary way through which data is accessed (instead of components), and the API will likely have some differences from what is currently available.
0 commit comments