From a1cad54a6c99f3cd45785c94ba0dbc929c6bcadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=A6?= <53305259+myNameIsDu@users.noreply.github.com> Date: Thu, 5 Aug 2021 11:30:23 +0800 Subject: [PATCH] perf: remove unused code (#1788) --- test/components/connect.spec.tsx | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/test/components/connect.spec.tsx b/test/components/connect.spec.tsx index afd4e187f..a63660e99 100644 --- a/test/components/connect.spec.tsx +++ b/test/components/connect.spec.tsx @@ -1,6 +1,6 @@ /*eslint-disable react/prop-types*/ -import React, { Component, MouseEvent, ComponentType } from 'react' +import React, { Component, MouseEvent } from 'react' import createClass from 'create-react-class' import PropTypes from 'prop-types' import ReactDOM from 'react-dom' @@ -81,23 +81,6 @@ describe('React', () => { return action.type === 'APPEND' ? prev + action.body : prev } - function imitateHotReloading( - TargetClass: ComponentType, - SourceClass: ComponentType, - container: Component - ) { - // Crude imitation of hot reloading that does the job - Object.getOwnPropertyNames(SourceClass.prototype) - .filter((key) => typeof SourceClass.prototype[key] === 'function') - .forEach((key) => { - if (key !== 'render' && key !== 'constructor') { - TargetClass.prototype[key] = SourceClass.prototype[key] - } - }) - - container.forceUpdate() - } - afterEach(() => rtl.cleanup()) describe('Core subscription and prop passing behavior', () => {