This component is deprecated. For more information, see Migrating from dashboard-react.
A React component that renders an HTML anchor element that leads to a dashboard page.
The PageLink
component accepts the following props:
Name | Type | Description |
---|---|---|
destination | Destination | Destination for the desired link. |
onClick | Function | On click event handler. |
children | React children prop | Link content |
Name | Type | Description |
---|---|---|
pageId | string | ID of the page to link to. Use the Page IDs table to find the appropriate ID. |
relativeUrl | string | Optional. URL segment to append to the base URL of the selected page. Can include path segments, a query string, and a fragment identifier. |
In addition, the component will forward other props to the inline anchor element.
To set up a dashboard client for React, refer to the setup guide.
import { withDashboard, PageLink } from '@wix/dashboard-react';
const DashboardExtension = () => {
return <PageLink destination={{pageId: '2e96bad1-df32-47b6-942f-e3ecabd74e57'}}>Back home</PageLink>
});
// Wrap the topmost component of your dashboard extension with 'withDashboard()'
export default withDashboard(DashboardExtension)