Skip to content

Commit

Permalink
Add display name to namespace context for improved debuggability
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlanGreene committed Sep 19, 2022
1 parent ebfcea1 commit e1c0322
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export function getTektonAPI(
}

export const NamespaceContext = React.createContext();
NamespaceContext.displayName = 'Namespace';

function getResourceVersion(resource) {
return parseInt(resource.metadata.resourceVersion, 10);
Expand Down

0 comments on commit e1c0322

Please sign in to comment.