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()
そして useDashboard()
and that the dashboard's contextual state is passed to all child components.
注:
When you wrap a component with withDashboard()
, a WixProvider
component is initialized behind the scenes with the dashboard host and authentication strategy.
1
名称 | タイプ | 説明 |
---|---|---|
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
.
1
This example shows how to retrieve a property called 名称
from the dashboard's contextual state and use it in a component's code.
1