-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import Alert from '@material-ui/core/Alert'; | ||
|
||
export default Alert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
import React from 'react'; | ||
import warning from 'warning'; | ||
import Alert from '@material-ui/core/Alert'; | ||
|
||
let warnedOnce = false; | ||
|
||
export default React.forwardRef(function DeprecatedAlert(props, ref) { | ||
let warnedOnce = false; | ||
|
||
warning( | ||
warnOnce, | ||
if (!warnedOnce) { | ||
console.warn( | ||
[ | ||
'Material-UI: the Alert component was moved from the lab to the core.', | ||
'', | ||
"You should use `import { Alert } from '@material-ui/core'`", | ||
"or `import Alert from '@material-ui/core/Alert'`", | ||
].join('\n'), | ||
); | ||
|
||
[ | ||
'Material-UI: the Alert component was moved from the lab to the core.', | ||
'', | ||
"You should use `import { Alert } from '@material-ui/core'`", | ||
"or `import Alert from '@material-ui/core/Alert'`", | ||
].join('\n'), | ||
); | ||
|
||
warnOnce = true; | ||
warnedOnce = true; | ||
} | ||
|
||
return <Alert ref={ref} {...props} />; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import AlertTitle from '@material-ui/core/AlertTitle'; | ||
|
||
export default AlertTitle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import React from 'react'; | ||
import warning from 'warning'; | ||
import AlertTitle from '@material-ui/core/AlertTitle'; | ||
|
||
export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { | ||
let warnOnce = false; | ||
let warnedOnce = false; | ||
|
||
warning( | ||
warnOnce, | ||
[ | ||
'Material-UI: the AlertTitle component was moved from the lab to the core.', | ||
'', | ||
"You should use `import { AlertTitle } from '@material-ui/core'`", | ||
"or `import AlertTitle from '@material-ui/core/AlertTitle'`", | ||
].join('\n'), | ||
); | ||
|
||
warnOnce = true; | ||
if (!warnedOnce) { | ||
console.warn( | ||
[ | ||
'Material-UI: the AlertTitle component was moved from the lab to the core.', | ||
'', | ||
"You should use `import { AlertTitle } from '@material-ui/core'`", | ||
"or `import AlertTitle from '@material-ui/core/AlertTitle'`", | ||
].join('\n'), | ||
); | ||
|
||
warnedOnce = true; | ||
} | ||
|
||
return <AlertTitle ref={ref} {...props} />; | ||
}); |