Skip to content

Commit

Permalink
Fix unecessary use of useCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusps committed Mar 20, 2019
1 parent 318d084 commit 687159d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions react/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { compose, path } from 'ramda'
import React, { useState, useCallback } from 'react'
import React, { useState } from 'react'
import { graphql } from 'react-apollo'
import { injectIntl } from 'react-intl'
import { withSession } from 'vtex.render-runtime'
Expand Down Expand Up @@ -30,11 +30,11 @@ const TelemarketingContainer = (props: Props) => {
const { intl, session } = props
const processedSession = processSession(session)

const handleInputChange = useCallback((event: any) => {
const handleInputChange = (event: any) => {
setEmailInput(event.target.value)
}, [])
}

const handleDepersonify = useCallback(() => {
const handleDepersonify = () => {
const { depersonify, session } = props
setloadingImpersonate(true)
depersonify()
Expand All @@ -45,9 +45,9 @@ const TelemarketingContainer = (props: Props) => {
setEmailInput('')
})
.catch(() => setloadingImpersonate(false))
}, [])
}

const handleSetSession = useCallback((email: string) => {
const handleSetSession = (email: string) => {
const { impersonate, session } = props
setloadingImpersonate(true)
const variables = { email }
Expand All @@ -61,7 +61,7 @@ const TelemarketingContainer = (props: Props) => {
setloadingImpersonate(false)
})
.catch(() => setloadingImpersonate(false))
}, [])
}

if (processedSession) {
const { client, canImpersonate, attendantEmail } = processedSession
Expand Down

0 comments on commit 687159d

Please sign in to comment.