From f3fc83b40105881651accfb712729d4761c109cd 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 provider 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 33e528a70..be0acf072 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);