1- /* eslint-disable no-undef */
2- /* eslint-disable no-alert */
3- import React , { useEffect , useState } from 'react' ;
1+ import React , { useEffect , useState , useCallback } from 'react' ;
42import { useDispatch , useSelector , shallowEqual } from 'react-redux' ;
53import { Redirect , Link } from 'react-router-dom' ;
64import classNames from 'classnames' ;
@@ -72,17 +70,17 @@ const Login = () => {
7270
7371 const iconsClassName = classNames ( 'icon' , classes . icon ) ;
7472
75- const onFacebookHandler = ( ) => {
73+ const onFacebookHandler = useCallback ( ( ) => {
7674 dispatch ( authFacebook ( ) ) ;
77- } ;
75+ } , [ dispatch , authFacebook ] ) ;
7876
79- const onGoogleHandler = ( ) => {
77+ const onGoogleHandler = useCallback ( ( ) => {
8078 dispatch ( authGoogle ( ) ) ;
81- } ;
79+ } , [ dispatch , authGoogle ] ) ;
8280
83- const onMicrosoftHandler = ( ) => {
81+ const onMicrosoftHandler = useCallback ( ( ) => {
8482 dispatch ( authMicrosoft ( ) ) ;
85- } ;
83+ } , [ dispatch , authMicrosoft ] ) ;
8684
8785 const inputs = isEmailLink
8886 ? inputValidations ( authData . email , authData . password , locale )
@@ -224,7 +222,6 @@ const Login = () => {
224222 'is-facebook' ,
225223 classes . socialButton
226224 ) }
227- id = "facebook"
228225 onClick = { onFacebookHandler }
229226 >
230227 < span className = { iconsClassName } >
@@ -234,7 +231,6 @@ const Login = () => {
234231 </ a >
235232 < a
236233 className = { classNames ( 'is-google' , classes . socialButton ) }
237- id = "google"
238234 onClick = { onGoogleHandler }
239235 >
240236 < span className = { iconsClassName } >
@@ -247,7 +243,6 @@ const Login = () => {
247243 'is-microsoft' ,
248244 classes . socialButton
249245 ) }
250- id = "microsoft"
251246 onClick = { onMicrosoftHandler }
252247 >
253248 < span className = { iconsClassName } >
0 commit comments