Skip to content

Commit

Permalink
feat(General): adding display name to react contexts (#1936)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipdanisko committed Jun 10, 2020
1 parent 67e88d6 commit c1a0da4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Card/CardContext.js
Expand Up @@ -17,6 +17,7 @@ export const cardDefault: Context = {
};

const context: React.Context<Context> = React.createContext(cardDefault);
context.displayName = "CardOrbitContext";

export const useCard = () => React.useContext(context);

Expand Down
1 change: 1 addition & 0 deletions src/Dictionary/DictionaryContext.js
Expand Up @@ -4,5 +4,6 @@ import * as React from "react";
import type { DictionaryContextType } from "./DictionaryContext";

const DictionaryContext: DictionaryContextType = React.createContext({});
DictionaryContext.displayName = "DictionaryOrbitContext";

export default DictionaryContext;
1 change: 1 addition & 0 deletions src/List/ListContext.js
Expand Up @@ -7,5 +7,6 @@ const ListContext: ListContextType = React.createContext({
size: null,
type: null,
});
ListContext.displayName = "ListOrbitContext";

export default ListContext;
2 changes: 1 addition & 1 deletion src/Modal/ModalContext.js
Expand Up @@ -12,7 +12,7 @@ export const ModalContext: ModalContextType = React.createContext({
isInsideModal: false,
closable: false,
});

ModalContext.displayName = "ModalOrbitContext";
export const withModalContext: WithModalContextType = Component => props => (
<ModalContext.Consumer>
{
Expand Down
1 change: 1 addition & 0 deletions src/ThemeProvider/QueryContext/index.js
Expand Up @@ -10,5 +10,6 @@ const QueryContext: QueryContextType = React.createContext({
isMediumMobile: null,
isTablet: null,
});
QueryContext.displayName = "QueryOrbitContext";

export default QueryContext;
1 change: 1 addition & 0 deletions src/deprecated/Card/CardSection/CardSectionContext.js
Expand Up @@ -9,5 +9,6 @@ const CardSectionContext: CardSectionContextType = React.createContext({
handleToggleSection: () => {},
onKeyDownHandler: () => {},
});
CardSectionContext.displayName = "CardDeprecatedOrbitContext";

export default CardSectionContext;

0 comments on commit c1a0da4

Please sign in to comment.