Skip to content

Commit aa8295e

Browse files
committed
Remove second targetArray fetching
1 parent e5ac7d0 commit aa8295e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/decorators/bodyMode.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ export default function (target) {
5757
return this.props.bodyMode
5858
}
5959

60-
target.prototype.bindBodyListener = function () {
60+
target.prototype.bindBodyListener = function (targetArray) {
6161
const { id } = this.props
6262
const { event, eventOff } = this.state
63-
const targetArray = this.getTargetArray(id)
6463
const body = getBody()
6564

6665
const customEvents = findCustomEvents(targetArray, 'data-event')

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class ReactTooltip extends Component {
182182
})
183183

184184
if (this.isBodyMode()) {
185-
this.bindBodyListener()
185+
this.bindBodyListener(targetArray)
186186
} else {
187187
targetArray.forEach(target => {
188188
const isCaptureMode = this.isCapture(target)

0 commit comments

Comments
 (0)