Overview
The WeaveProvider is a core component from the React Helper library that initializes and provides Weave.js context to your React application. It sets up the needed elements for real-time collaboration and canvas rendering:
-
Store
-
Nodes
-
Plugins
-
Actions
-
Fonts
By wrapping your app (or part of it) with WeaveProvider, you can make use of the useWeave hook to access the API of the Weave instance.
|
Nodes, Actions and Plugins by default?
By default this helper doesn’t include any nodes, actions or plugins. You must add your own. |
types
export type WeavePerformanceConfig = {
upscale?: Partial<WeaveUpscaleConfig>;
};
export type WeaveUpscaleConfig = {
enabled?: boolean;
multiplier?: number;
baseWidth?: number;
baseHeight?: number;
};
Props
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
|
Required |
A function that returns an HTMLDivElement where Weave.js will setup |
|
|
|
Required |
Weave.js Store to use to handle the real-time communication |
|
|
|
Required |
Weave.js Renderer to use to handle the real-time reconciliation of the shared state |
|
|
|
Required |
Child nodes to render |
|
|
|
|
Array of nodes to register and use by the instance |
|
|
|
|
Array of plugins to register and use by the instance |
|
|
|
|
Array of actions to register and use by the instance |
|
|
|
|
Array of custom plugins to register and use by the instance |
|
|
|
|
Array that define the fonts to use on the canvas |
|
|
|
|
Global log level of Weave.js instance |
|
|
|
|
Define a custom log level Weave.js internal modules, nodes, actions and plugins. When defining a custom level, the format is 'moduleName:level' |
|
|
|
Options to fine-tune performance of Weave.js instance |