Skip to content

Commit 3ce8286

Browse files
TCA-645 #comment This PR fixes a lint issue that i didn't understand how it worked and made the issue worse. Thanks Vasilica #time 15m
1 parent dd56bd7 commit 3ce8286

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src-ts/header/utility-selectors/UtilitySelector/ProfileSelector/profile-not-logged-in/ProfileNotLoggedIn.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC, useContext } from 'react'
1+
import { FC, useCallback, useContext } from 'react'
22
import { Location, useLocation } from 'react-router-dom'
33

44
import {
@@ -14,10 +14,13 @@ const ProfileNotLoggedIn: FC<{}> = () => {
1414
const routeData: RouteContextData = useContext(routeContext)
1515
const location: Location = useLocation()
1616

17-
function signUp(): void {
17+
const signUpHandler: () => void = useCallback(() => {
1818
const signupUrl: string = routeData.getSignupUrl(location.pathname, routeData.toolsRoutes)
1919
window.location.href = signupUrl
20-
}
20+
}, [
21+
location.pathname,
22+
routeData,
23+
])
2124

2225
return (
2326
<>
@@ -34,7 +37,7 @@ const ProfileNotLoggedIn: FC<{}> = () => {
3437
label='Sign Up'
3538
size='md'
3639
tabIndex={-1}
37-
onClick={() => signUp()}
40+
onClick={signUpHandler}
3841
/>
3942
</>
4043
)

0 commit comments

Comments
 (0)