diff --git a/packages/grafana-runtime/src/utils/returnToPrevious.ts b/packages/grafana-runtime/src/utils/returnToPrevious.ts index 7b699cad7b4..7810eb46c0a 100644 --- a/packages/grafana-runtime/src/utils/returnToPrevious.ts +++ b/packages/grafana-runtime/src/utils/returnToPrevious.ts @@ -6,6 +6,11 @@ export const setReturnToPreviousHook = (hook: ReturnToPreviousHook) => { rtpHook = hook; }; +/** + * Guidelines: + * - Only use the ‘Return to previous’ functionality when the user is sent to another context, such as from Alerting to a dashboard. + * - Specify a button title that identifies the page to return to in the most understandable way. Do not use text such as ‘Back to the previous page’. Be specific. + */ export const useReturnToPrevious: ReturnToPreviousHook = () => { if (!rtpHook) { if (process.env.NODE_ENV !== 'production') {