From e1c032206d32bde07f662824d0d2ea5671ab0b55 Mon Sep 17 00:00:00 2001 From: Alan Greene Date: Mon, 19 Sep 2022 15:07:41 +0100 Subject: [PATCH] Add display name to namespace context for improved debuggability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding the `displayName` improves stacks displayed in error console and React dev tools so the provided is shown as `Namespace.Provider` instead of the default `Context.Provider` (of which there are already a few…). This makes it easier to identify the relevant code / component. --- src/api/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/utils.js b/src/api/utils.js index 33e528a703..be0acf072c 100644 --- a/src/api/utils.js +++ b/src/api/utils.js @@ -115,6 +115,7 @@ export function getTektonAPI( } export const NamespaceContext = React.createContext(); +NamespaceContext.displayName = 'Namespace'; function getResourceVersion(resource) { return parseInt(resource.metadata.resourceVersion, 10);