IReactTreeDataObject Interface
A schema-aware tree-backed DataObject, extended with a React Component to view the tree.
To use, import via @fluidframework/react/alpha.
For more information about our API support guarantees, see here.
This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.
Signature
/** @sealed */
export interface IReactTreeDataObject<TSchema extends ImplicitFieldSchema>
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| TSchema | ImplicitFieldSchema |
Remarks
Allows for the Tree's schema to be baked into the container schema.
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| config | Alpha | readonly | TreeViewConfiguration<TSchema> | The configuration used to initialize new documents, as well as to interpret (schematize) existing ones. |
| treeView | Alpha | readonly | TreeView<TSchema> | The schema-aware view of the tree. |
| TreeViewComponent | Alpha | readonly | (props: TreeViewProps<TSchema>) => JSX.Element | React component which handles schematizing trees. This includes displaying errors when the document can not be viewed using the view schema. |
Property Details
config
The configuration used to initialize new documents, as well as to interpret (schematize) existing ones.
For more information about our API support guarantees, see here.
Signature
readonly config: TreeViewConfiguration<TSchema>;
Type: TreeViewConfiguration<TSchema>
Remarks
The fact that a single view schema is provided here (on the data object) makes it impossible to try and apply multiple different schema. Since the view schema currently does not provide any adapters for handling differences between view and stored schema, it's also impossible for this single view schema to handle multiple different stored schema. Therefore, with this current API, two different applications (or different versions of the same application) with differing stored schema requirements (as implied by their view schema) can not collaborate on the same tree. The only schema evolution that's currently possible is upgrading the schema to one that supports a superset of what the old schema allowed, and collaborating between clients which have view schema that exactly correspond to that stored schema. Future work on tree as well as these utilities should address this limitation.
treeView
The schema-aware view of the tree.
For more information about our API support guarantees, see here.
Signature
readonly treeView: TreeView<TSchema>;
Type: TreeView<TSchema>
TreeViewComponent
React component which handles schematizing trees. This includes displaying errors when the document can not be viewed using the view schema.
For more information about our API support guarantees, see here.
Signature
readonly TreeViewComponent: (props: TreeViewProps<TSchema>) => JSX.Element;
Type: (props: TreeViewProps<TSchema>) => JSX.Element