forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request react-bootstrap#600 from AlexKVal/fixGlobWarning
Fix for bug introduced by deprecation code.
- Loading branch information
Showing
4 changed files
with
22 additions
and
16 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
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,12 +1,7 @@ | ||
import deprecationWarning from './utils/deprecationWarning'; | ||
import CollapsibleNav from './CollapsibleNav'; | ||
|
||
let CollapsableNav = CollapsibleNav; | ||
|
||
deprecationWarning( | ||
'CollapsableNav', | ||
'CollapsibleNav', | ||
'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963' | ||
); | ||
CollapsableNav.__deprecated__ = true; | ||
|
||
export default CollapsableNav; |
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
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,16 +1,14 @@ | ||
function warn(message) { | ||
if (window.console && (typeof console.warn === 'function')) { | ||
console.warn(message); | ||
} | ||
} | ||
|
||
export default function deprecationWarning(oldname, newname, link) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!window.console && (typeof console.warn !== 'function')) { | ||
return; | ||
} | ||
|
||
let message = `${oldname} is deprecated. Use ${newname} instead.`; | ||
warn(message); | ||
console.warn(message); | ||
|
||
if (link) { | ||
warn(`You can read more about it here ${link}`); | ||
console.warn(`You can read more about it here ${link}`); | ||
} | ||
} | ||
} |