diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c06c79..95e38e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [2.8.1] - 2019-03-20 + +### Fixed + +- Infinite loop on useCallback. + ## [2.8.0] - 2019-03-20 ### Added diff --git a/manifest.json b/manifest.json index 84dccfa..75b541a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "vendor": "vtex", "name": "telemarketing", - "version": "2.8.0", + "version": "2.8.1", "title": "VTEX Telemarketing", "defaultLocale": "pt-BR", "description": "The VTEX telemarketing app", diff --git a/react/index.tsx b/react/index.tsx index 059baa1..7177ccb 100644 --- a/react/index.tsx +++ b/react/index.tsx @@ -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' @@ -30,14 +30,11 @@ const TelemarketingContainer = (props: Props) => { const { intl, session } = props const processedSession = processSession(session) - const handleInputChange = useCallback( - (event: any) => { - setEmailInput(event.target.value) - }, - [event] - ) + const handleInputChange = (event: any) => { + setEmailInput(event.target.value) + } - const handleDepersonify = useCallback(() => { + const handleDepersonify = () => { const { depersonify, session } = props setloadingImpersonate(true) depersonify() @@ -48,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 } @@ -64,7 +61,7 @@ const TelemarketingContainer = (props: Props) => { setloadingImpersonate(false) }) .catch(() => setloadingImpersonate(false)) - }, []) + } if (processedSession) { const { client, canImpersonate, attendantEmail } = processedSession