Skip to content

Commit 489d488

Browse files
committed
only warn when min or max are provided with wrong variant
1 parent d99727b commit 489d488

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/mui-material/src/CircularProgress/CircularProgress.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const CircularProgress = React.forwardRef(function CircularProgress(inProps, ref
199199

200200
if (process.env.NODE_ENV !== 'production') {
201201
if (variant === 'indeterminate' && (minProp !== undefined || maxProp !== undefined)) {
202-
console.error(
202+
console.warn(
203203
`MUI: You have provided the \`min\` or \`max\` props with a 'indeterminate' variant. These props will have no effect.`,
204204
);
205205
}

packages/mui-material/src/CircularProgress/CircularProgress.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ describe('<CircularProgress />', () => {
240240
]);
241241
});
242242

243-
it('should error if min and max props are provided with an indeterminate variant', () => {
243+
it('should warn if min and max props are provided with an indeterminate variant', () => {
244244
expect(() => {
245245
render(<CircularProgress variant="indeterminate" min={0} max={10} />);
246-
}).toErrorDev([
246+
}).toWarnDev([
247247
"MUI: You have provided the `min` or `max` props with a 'indeterminate' variant. These props will have no effect.",
248248
!strictModeDoubleLoggingSuppressed &&
249249
"MUI: You have provided the `min` or `max` props with a 'indeterminate' variant. These props will have no effect.",

packages/mui-material/src/LinearProgress/LinearProgress.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ const LinearProgress = React.forwardRef(function LinearProgress(inProps, ref) {
375375
['indeterminate', 'query'].includes(variant) &&
376376
(minProp !== undefined || maxProp !== undefined)
377377
) {
378-
console.error(
378+
console.warn(
379379
`MUI: You have provided the \`min\` or \`max\` props with a 'indeterminate' or 'query' variant. These props will have no effect.`,
380380
);
381381
}

packages/mui-material/src/LinearProgress/LinearProgress.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,18 @@ describe('<LinearProgress />', () => {
301301
]);
302302
});
303303

304-
it('should error if variant is indeterminate or query and min or max props are provided', () => {
304+
it('should warn if variant is indeterminate or query and min or max props are provided', () => {
305305
expect(() => {
306306
render(<LinearProgress variant="indeterminate" min={0} />);
307-
}).toErrorDev([
307+
}).toWarnDev([
308308
"MUI: You have provided the `min` or `max` props with a 'indeterminate' or 'query' variant. These props will have no effect.",
309309
!strictModeDoubleLoggingSuppressed &&
310310
"MUI: You have provided the `min` or `max` props with a 'indeterminate' or 'query' variant. These props will have no effect.",
311311
]);
312312

313313
expect(() => {
314314
render(<LinearProgress variant="query" max={100} />);
315-
}).toErrorDev([
315+
}).toWarnDev([
316316
"MUI: You have provided the `min` or `max` props with a 'indeterminate' or 'query' variant. These props will have no effect.",
317317
!strictModeDoubleLoggingSuppressed &&
318318
"MUI: You have provided the `min` or `max` props with a 'indeterminate' or 'query' variant. These props will have no effect.",

0 commit comments

Comments
 (0)