Skip to content

Commit

Permalink
Merge pull request #8 from space-fe/fix/arrow-function-comp-check
Browse files Browse the repository at this point in the history
fix: arrow function component check
  • Loading branch information
XiaocongDong authored Jul 5, 2019
2 parents 92bd8d2 + d1fcfe1 commit c4eb0e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion es/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var onRouteChangedHOC = function onRouteChangedHOC(DecoratedComponent) {
config.mounted = config.mounted === undefined ? false : config.mounted;
config.onlyPathname = config.onlyPathname === undefined ? true : config.onlyPathname;
var componentName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
var isReactComponent = DecoratedComponent.prototype.isReactComponent;
var isReactComponent = DecoratedComponent.prototype && DecoratedComponent.prototype.isReactComponent;

var RouteChangedComponent =
/*#__PURE__*/
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const onRouteChangedHOC = (DecoratedComponent, config = { mounted: false, onlyPa
config.onlyPathname = config.onlyPathname === undefined ? true : config.onlyPathname

const componentName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component'
const isReactComponent = DecoratedComponent.prototype.isReactComponent
const isReactComponent = DecoratedComponent.prototype && DecoratedComponent.prototype.isReactComponent

class RouteChangedComponent extends React.Component {
static displayName = `OnRouteChanged(${componentName})`
Expand Down

0 comments on commit c4eb0e3

Please sign in to comment.