Skip to content

Commit

Permalink
fix(panel): using function for right 'this' context in tab constructor (
Browse files Browse the repository at this point in the history
  • Loading branch information
jeetiss authored Aug 14, 2019
1 parent 1ecd058 commit 91a6d20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hooks/use-custom-tabs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { useEffect } from 'react'

const noop = () => null
const noop = function () {}

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

customTabs.forEach(([name, implementation]) => {
uploadcare.registerTab(name, (...args) =>
implementation(...args, uploadcare)
)
uploadcare.registerTab(name, function (...args) {
return implementation(...args, uploadcare)
})
})

return () =>
Expand Down

0 comments on commit 91a6d20

Please sign in to comment.