Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/src/modules/components/PageContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ const PageContext = React.createContext({
pages: [],
});

if (process.env.NODE_ENV !== 'production') {
PageContext.displayName = 'PageContext';
}

export default PageContext;
6 changes: 5 additions & 1 deletion docs/src/modules/components/ThemeContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ const highDensity = {
};

export const DispatchContext = React.createContext(() => {
throw new Error('Forgot to wrap component in ThemeContext.Provider');
throw new Error('Forgot to wrap component in `ThemeProvider`');
});

if (process.env.NODE_ENV !== 'production') {
DispatchContext.displayName = 'ThemeDispatchContext';
}

const useEnhancedEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;

export function ThemeProvider(props) {
Expand Down
8 changes: 7 additions & 1 deletion packages/material-ui-lab/src/TreeView/TreeViewContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ import React from 'react';
/**
* @ignore - internal component.
*/
export default React.createContext({});
const TreeViewContext = React.createContext({});

if (process.env.NODE_ENV !== 'production') {
TreeViewContext.displayName = 'TreeViewContext';
}

export default TreeViewContext;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const defaultOptions = {

export const StylesContext = React.createContext(defaultOptions);

if (process.env.NODE_ENV !== 'production') {
StylesContext.displayName = 'StylesContext';
}

let injectFirstNode;

function StylesProvider(props) {
Expand Down
4 changes: 4 additions & 0 deletions packages/material-ui-styles/src/useTheme/ThemeContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ import React from 'react';

const ThemeContext = React.createContext(null);

if (process.env.NODE_ENV !== 'production') {
ThemeContext.displayName = 'ThemeContext';
}

export default ThemeContext;
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ import React from 'react';
*/
const ExpansionPanelContext = React.createContext({});

if (process.env.NODE_ENV !== 'production') {
ExpansionPanelContext.displayName = 'ExpansionPanelContext';
}

export default ExpansionPanelContext;
4 changes: 4 additions & 0 deletions packages/material-ui/src/FormControl/FormControlContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import React from 'react';
*/
const FormControlContext = React.createContext();

if (process.env.NODE_ENV !== 'production') {
FormControlContext.displayName = 'FormControlContext';
}

export function useFormControl() {
return React.useContext(FormControlContext);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/material-ui/src/List/ListContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ import React from 'react';
*/
const ListContext = React.createContext({});

if (process.env.NODE_ENV !== 'production') {
ListContext.displayName = 'ListContext';
}

export default ListContext;
4 changes: 4 additions & 0 deletions packages/material-ui/src/RadioGroup/RadioGroupContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ import React from 'react';
*/
const RadioGroupContext = React.createContext();

if (process.env.NODE_ENV !== 'production') {
RadioGroupContext.displayName = 'RadioGroupContext';
}

export default RadioGroupContext;
4 changes: 4 additions & 0 deletions packages/material-ui/src/Table/TableContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ import React from 'react';
*/
const TableContext = React.createContext();

if (process.env.NODE_ENV !== 'production') {
TableContext.displayName = 'TableContext';
}

export default TableContext;
4 changes: 4 additions & 0 deletions packages/material-ui/src/Table/Tablelvl2Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ import React from 'react';
*/
const Tablelvl2Context = React.createContext();

if (process.env.NODE_ENV !== 'production') {
Tablelvl2Context.displayName = 'Tablelvl2Context';
}

export default Tablelvl2Context;
4 changes: 4 additions & 0 deletions packages/material-ui/src/test-utils/RenderMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import * as PropTypes from 'prop-types';

const Context = React.createContext();

if (process.env.NODE_ENV !== 'production') {
Context.displayName = 'RenderContext';
}

/**
* @ignore - internal component.
*/
Expand Down