This component is deprecated. For more information, see Migrating from dashboard-react.
This hook is temporarily required for use in Wix Patterns. It will continue to be supported while it is required.
A higher-order component that initializes the Wix React SDK and the Wix Dashboard SDK.
Wrap your topmost component with withDashboard()
. This setup ensures that nested components can use hooks like useWixModules()
and useDashboard()
and that the dashboard's contextual state is passed to all child components.
Note:
When you wrap a component with withDashboard()
, a WixProvider
component is initialized behind the scenes with the dashboard host and authentication strategy.
Name | Type | Description |
---|---|---|
Component | React.ComponentType<P> | A React component. |
React.ComponentType<unknown>
To set up a dashboard client for React, refer to the setup guide.
Here is a basic example of how to wrap a component using withDashboard
.
This example shows how to retrieve a property called name
from the dashboard's contextual state and use it in a component's code.