Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the subtle bug with deprecation warning.
When deprecated `Collaps_a_bleNav` is imported it also tags `Collaps_i_bleNav` element as deprecated, because it is done by using pointers which points to the same object. ```js let CollapsableNav = CollapsibleNav; CollapsableNav.__deprecated__ = true; ``` https://github.com/react-bootstrap/react-bootstrap/blob/92c57ef7ee/src/CollapsableNav.js#L5 The right and simplest way to make deprecation in the case of component renaming `CollapsableNav => CollapsibleNav` by using general for both components part - `classSpecifications`. Like this: ```js // NewNameComponent.js const classSpecificationsFor_NewNameComponent = { /* existing code */ }; const NewNameComponent = React.createClass( classSpecificationsFor_NewNameComponent ); export {classSpecificationsFor_NewNameComponent}; // for old component export default NewNameComponent; // OldNameComponent.js import {classSpecificationsFor_NewNameComponent} from 'NewNameComponent'; const classSpecsFor_OldNameComponent = assign({}, classSpecificationsFor_NewNameComponent, { // here we add deprecation warning }); const OldNameComponent = React.createClass( classSpecsFor_OldNameComponent ); export default OldNameComponent; ```
- Loading branch information