enzyme-adapter-react-16
Advanced tools
Comparing version 1.15.4 to 1.15.5
{ | ||
"name": "enzyme-adapter-react-16", | ||
"version": "1.15.4", | ||
"version": "1.15.5", | ||
"description": "JavaScript Testing utilities for React", | ||
@@ -63,3 +63,3 @@ "homepage": "https://enzymejs.github.io/enzyme/", | ||
"enzyme": "^3.0.0", | ||
"eslint": "^7.7.0", | ||
"eslint": "^7.9.0", | ||
"eslint-config-airbnb": "^18.2.0", | ||
@@ -69,3 +69,3 @@ "eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-react": "^7.20.6", | ||
"eslint-plugin-react-hooks": "^4.1.0", | ||
"eslint-plugin-react-hooks": "^4.1.2", | ||
"in-publish": "^2.0.1", | ||
@@ -72,0 +72,0 @@ "rimraf": "^2.7.1", |
@@ -135,28 +135,38 @@ /* eslint no-use-before-define: 0 */ | ||
if (isStateful(prerenderEl.type)) { | ||
class FakeSuspense extends prerenderEl.type { | ||
render() { | ||
const { | ||
propTypes, | ||
defaultProps, | ||
contextTypes, | ||
contextType, | ||
childContextTypes, | ||
} = renderedEl.type; | ||
const FakeSuspense = Object.assign( | ||
isStateful(prerenderEl.type) | ||
? class FakeSuspense extends prerenderEl.type { | ||
render() { | ||
const { type, props } = prerenderEl; | ||
return React.createElement( | ||
type, | ||
{ ...props, ...this.props }, | ||
children, | ||
); | ||
} | ||
} | ||
: function FakeSuspense(props) { // eslint-disable-line prefer-arrow-callback | ||
return React.createElement( | ||
prerenderEl.type, | ||
{ ...prerenderEl.props, ...this.props }, | ||
renderedEl.type, | ||
{ ...renderedEl.props, ...props }, | ||
children, | ||
); | ||
} | ||
} | ||
return React.createElement(FakeSuspense, null, children); | ||
} | ||
return React.createElement( | ||
// eslint-disable-next-line prefer-arrow-callback | ||
function FakeSuspense(props) { | ||
return React.createElement( | ||
renderedEl.type, | ||
{ ...renderedEl.props, ...props }, | ||
children, | ||
); | ||
}, | ||
{ | ||
propTypes, | ||
defaultProps, | ||
contextTypes, | ||
contextType, | ||
childContextTypes, | ||
}, | ||
null, | ||
children, | ||
); | ||
return React.createElement(FakeSuspense, null, children); | ||
} | ||
@@ -163,0 +173,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
275620
2720