Skip to content

Commit

Permalink
[Accordion, Collapse] Fix failed proptype error (#27307)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenalin121 authored Jul 15, 2021
1 parent f3d2d7a commit fdb2f17
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions packages/material-ui/src/Accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,13 @@ Accordion.propTypes = {
*/
classes: chainPropTypes(PropTypes.object, (props) => {
if (props.classes && props.classes.focused) {
throw new Error([
'Material-UI: the classes.focused key is deprecated.',
'Use `classes.focusedVisible` instead',
'The name of the pseudo-class was changed for consistency.',
]).join('\n');
throw new Error(
[
'Material-UI: the classes.focused key is deprecated.',
'Use `classes.focusedVisible` instead',
'The name of the pseudo-class was changed for consistency.',
].join('\n'),
);
}

return null;
Expand Down
12 changes: 7 additions & 5 deletions packages/material-ui/src/Collapse/Collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,13 @@ Collapse.propTypes = {
*/
classes: chainPropTypes(PropTypes.object, (props) => {
if (props.classes && props.classes.container) {
throw new Error([
'Material-UI: the classes.container key is deprecated.',
'Use `classes.root` instead',
'The name of the pseudo-class was changed for consistency.',
]).join('\n');
throw new Error(
[
'Material-UI: the classes.container key is deprecated.',
'Use `classes.root` instead',
'The name of the pseudo-class was changed for consistency.',
].join('\n'),
);
}

return null;
Expand Down

0 comments on commit fdb2f17

Please sign in to comment.