react-onclickoutside
Advanced tools
Comparing version 5.6.0 to 5.7.0
@@ -91,3 +91,3 @@ /** | ||
getInstance: function() { | ||
return this.refs.instance; | ||
return Component.prototype.isReactComponent ? this.refs.instance : this; | ||
}, | ||
@@ -211,6 +211,8 @@ | ||
}); | ||
props.ref = 'instance'; | ||
if (Component.prototype.isReactComponent) { | ||
props.ref = 'instance'; | ||
} | ||
props.disableOnClickOutside = this.disableOnClickOutside; | ||
props.enableOnClickOutside = this.enableOnClickOutside; | ||
return React.createElement(Component, props); | ||
return React.createElement(Component, props); | ||
} | ||
@@ -217,0 +219,0 @@ }); |
{ | ||
"name": "react-onclickoutside", | ||
"version": "5.6.0", | ||
"version": "5.7.0", | ||
"description": "An onClickOutside mixin for React components", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,2 +7,4 @@ # An onClickOutside wrapper for React components | ||
This HOC supports stateless components as of v5.7.0 | ||
## Installation | ||
@@ -9,0 +11,0 @@ |
@@ -69,4 +69,4 @@ var React = require('react'); | ||
}); | ||
describe('with instance method', function() { | ||
@@ -116,3 +116,3 @@ it('and class inheritance, should call the specified handler when clicking the document', function() { | ||
}, | ||
handleClickOutside: function(event) { | ||
@@ -122,3 +122,3 @@ if (event === undefined) { | ||
} | ||
this.setState({ | ||
@@ -128,3 +128,3 @@ clickOutsideHandled: true | ||
}, | ||
render: function() { | ||
@@ -202,5 +202,4 @@ return React.createElement('div'); | ||
// ToDo: Does not work | ||
it.skip('and stateless function, should call the specified handler when clicking the document', function() { | ||
it('and stateless function, should call the specified handler when clicking the document', function() { | ||
var Component = function() { | ||
@@ -207,0 +206,0 @@ return React.createElement('div'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32637
593
167