Move getDisplayName to react-utility-belt

This commit is contained in:
Brett Sun 2016-07-04 15:25:28 +02:00
parent bf68efcd96
commit 1511f06504
1 changed files with 3 additions and 7 deletions

10
js/utils/react.js vendored
View File

@ -1,7 +1,3 @@
/**
* Taken from react-router (https://github.com/reactjs/react-router/blob/master/modules/withRouter.js)
* FIXME: should be put into react-component's utils
*/
export function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}
// Ignore error as we may have more exports in the future
// eslint-disable-next-line import/prefer-default-export
export { getDisplayName } from 'react-utility-belt/es6/utils/react';