Last active
June 4, 2022 10:13
-
-
Save RomikMakavana/8f6729285548bfbe377a6beb29c2cc7f to your computer and use it in GitHub Desktop.
React Auth Guard Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
const AuthGuard = ({component}) => { | |
useEffect(() => { | |
console.log("Auth Guard"); | |
}, []); | |
return <React.Fragment>{component}</React.Fragment> | |
} | |
export default AuthGuard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
const UnAuthGuard = ({component}) => { | |
useEffect(() => { | |
console.log("UnAuth Guard"); | |
}, [component]); | |
return <React.Fragment>{component}</React.Fragment> | |
} | |
export default UnAuthGuard; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment