Skip to content

Commit

Permalink
[AccordionSummary] Fix false-positive propType warning with `disableG… (
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Jul 22, 2021
1 parent 8fd66a1 commit 4fe0df5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ AccordionSummary.propTypes = {
* See [CSS API](#css) below for more details.
*/
classes: chainPropTypes(PropTypes.object, (props) => {
if (props.classes.focused.indexOf(' ') !== -1) {
// Guard against when generation of classes is disabled in the stylesheets (`disableGeneration`).
// For `disableGeneration` we don't have an accurate warning but `disableGeneration` is an advanced use case anyway.
if (props.classes.focused !== undefined && props.classes.focused.indexOf(' ') !== -1) {
return new Error(
[
'Material-UI: The `classes.focused` key is deprecated.',
Expand Down

0 comments on commit 4fe0df5

Please sign in to comment.