In This Article
useDashboard
A React hook that provides access to the Dashboard SDK functions.
Signature
Copy
1() => ReactSDK
Returns
A ReactSDK
object with the following functions:
Examples
In order to set up a dashboard client for React, please refer to the setup guide.
Showing a toast
Copy
1import { withDashboard, useDashboard } from '@wix/dashboard-react';2
3export default withDashboard(() => {4 const { showToast } = useDashboard();5 const showToastOnClick = () => {6 showToast({ message: 'Hello World' });7 };8 9 return <button onClick={showToastOnClick}>Example</button>;10});
Was this helpful?
Yes
No