This hook is deprecated. For more information, see Migrating from dashboard-react.
A React hook that provides access to the Dashboard SDK functions.
() => ReactSDK;
A ReactSDK
object with the following functions:
To set up a dashboard client for React, refer to the setup guide.
import { withDashboard, useDashboard } from "@wix/dashboard-react";
const DashboardExtension = () => {
const { showToast } = useDashboard();
const showToastOnClick = () => {
showToast({ message: "Hello World" });
};
return <button onClick={showToastOnClick}>Example</button>;
};
// Wrap the topmost component of your dashboard extension with 'withDashboard()'
export default withDashboard(DashboardExtension);