ReturnToPrevious: Add guidelines to returnToPrevious hook (#83219)

This commit is contained in:
Laura Fernández
2024-02-26 12:08:00 +01:00
committed by GitHub
parent 2fa4ac2a73
commit f6fa248ac1
@@ -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') {