Skip to content

Commit

Permalink
[core] 100% remove the prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Dec 8, 2018
1 parent 02ccf5e commit a134072
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 12 deletions.
6 changes: 3 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module.exports = {
[
'transform-react-remove-prop-types',
{
mode: 'wrap',
mode: 'unsafe-wrap',
},
],
],
Expand All @@ -147,7 +147,7 @@ module.exports = {
[
'transform-react-remove-prop-types',
{
mode: 'wrap',
mode: 'unsafe-wrap',
},
],
],
Expand All @@ -163,7 +163,7 @@ module.exports = {
[
'transform-react-remove-prop-types',
{
mode: 'wrap',
mode: 'unsafe-wrap',
},
],
],
Expand Down
4 changes: 3 additions & 1 deletion packages/material-ui-docs/src/NProgressBar/NProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ NProgressBar.propTypes = {
children: PropTypes.node,
};

NProgressBar.propTypes = exactProp(NProgressBar.propTypes, 'NProgressBar');
if (process.env.NODE_ENV !== 'production') {
NProgressBar.propTypes = exactProp(NProgressBar.propTypes);
}

NProgressBar.defaultProps = {
children: null,
Expand Down
4 changes: 3 additions & 1 deletion packages/material-ui-styles/src/StylesProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ StylesProvider.propTypes = {
sheetsRegistry: PropTypes.object,
};

StylesProvider.propTypes = exactProp(StylesProvider.propTypes);
if (process.env.NODE_ENV !== 'production') {
StylesProvider.propTypes = exactProp(StylesProvider.propTypes);
}

StylesProvider.defaultProps = {
disableGeneration: false,
Expand Down
4 changes: 3 additions & 1 deletion packages/material-ui-styles/src/ThemeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ ThemeProvider.propTypes = {
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired,
};

ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes);
if (process.env.NODE_ENV !== 'production') {
ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes);
}

export default ThemeProvider;
4 changes: 3 additions & 1 deletion packages/material-ui/src/CssBaseline/CssBaseline.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ CssBaseline.propTypes = {
classes: PropTypes.object.isRequired,
};

CssBaseline.propTypes = exactProp(CssBaseline.propTypes);
if (process.env.NODE_ENV !== 'production') {
CssBaseline.propTypes = exactProp(CssBaseline.propTypes);
}

CssBaseline.defaultProps = {
children: null,
Expand Down
4 changes: 3 additions & 1 deletion packages/material-ui/src/Hidden/HiddenJs.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ HiddenJs.propTypes = {
xsUp: PropTypes.bool,
};

HiddenJs.propTypes = exactProp(HiddenJs.propTypes);
if (process.env.NODE_ENV !== 'production') {
HiddenJs.propTypes = exactProp(HiddenJs.propTypes);
}

export default withWidth()(HiddenJs);
4 changes: 3 additions & 1 deletion packages/material-ui/src/NoSsr/NoSsr.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ NoSsr.propTypes = {
fallback: PropTypes.node,
};

NoSsr.propTypes = exactProp(NoSsr.propTypes);
if (process.env.NODE_ENV !== 'production') {
NoSsr.propTypes = exactProp(NoSsr.propTypes);
}

NoSsr.defaultProps = {
defer: false,
Expand Down
4 changes: 3 additions & 1 deletion packages/material-ui/src/Portal/Portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Portal.defaultProps = {
disablePortal: false,
};

Portal.propTypes = exactProp(Portal.propTypes);
if (process.env.NODE_ENV !== 'production') {
Portal.propTypes = exactProp(Portal.propTypes);
}

export default Portal;
4 changes: 3 additions & 1 deletion packages/material-ui/src/RootRef/RootRef.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ RootRef.propTypes = {
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,
};

RootRef.propTypes = exactProp(RootRef.propTypes);
if (process.env.NODE_ENV !== 'production') {
RootRef.propTypes = exactProp(RootRef.propTypes);
}

export default RootRef;
4 changes: 3 additions & 1 deletion packages/material-ui/src/styles/MuiThemeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ MuiThemeProviderOld.propTypes = {
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired,
};

MuiThemeProviderOld.propTypes = exactProp(MuiThemeProviderOld.propTypes);
if (process.env.NODE_ENV !== 'production') {
MuiThemeProviderOld.propTypes = exactProp(MuiThemeProviderOld.propTypes);
}

MuiThemeProviderOld.childContextTypes = {
...themeListener.contextTypes,
Expand Down

0 comments on commit a134072

Please sign in to comment.