Skip to main content
Version: v2

IReactTreeDataObject Interface

A schema-aware tree-backed DataObject, extended with a React Component to view the tree.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/react/alpha.

For more information about our API support guarantees, see here.

Sealed

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​

ParameterConstraintDescription
TSchemaImplicitFieldSchema

Remarks​

Allows for the Tree's schema to be baked into the container schema.

Properties​

PropertyAlertsModifiersTypeDescription
configAlphareadonlyTreeViewConfiguration<TSchema>The configuration used to initialize new documents, as well as to interpret (schematize) existing ones.
treeViewAlphareadonlyTreeView<TSchema>The schema-aware view of the tree.
TreeViewComponentAlphareadonly(props: TreeViewProps<TSchema>) => JSX.ElementReact 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.

This API is provided as an alpha preview and may change without notice.

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.

This API is provided as an alpha preview and may change without notice.

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.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

readonly TreeViewComponent: (props: TreeViewProps<TSchema>) => JSX.Element;

Type: (props: TreeViewProps<TSchema>) => JSX.Element