Skip to content

Commit 91a6d20

Browse files
authored
fix(panel): using function for right 'this' context in tab constructor (#30)
1 parent 1ecd058 commit 91a6d20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hooks/use-custom-tabs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { useEffect } from 'react'
22

3-
const noop = () => null
3+
const noop = function () {}
44

55
export const useCustomTabs = (tabs, uploadcare) => {
66
useEffect(() => {
77
const customTabs = Object.entries(tabs || [])
88

99
customTabs.forEach(([name, implementation]) => {
10-
uploadcare.registerTab(name, (...args) =>
11-
implementation(...args, uploadcare)
12-
)
10+
uploadcare.registerTab(name, function (...args) {
11+
return implementation(...args, uploadcare)
12+
})
1313
})
1414

1515
return () =>

0 commit comments

Comments
 (0)