From 65c3e3dbb2304e502dcba5cc9650219dbb653f56 Mon Sep 17 00:00:00 2001 From: Jonas Lindenskov Nielsen Date: Thu, 6 Jun 2024 16:34:19 +0200 Subject: [PATCH] Fix code examples in documentation: Add missing return statements and remove superfluous else/else-if statements (#32) --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ffe5e45..bd27510 100644 --- a/README.md +++ b/README.md @@ -57,16 +57,18 @@ export default function App() { {JSON.stringify(result.id_token, null, 2)} ) - } else { + } + + return ( {result?.error ? (

- An error occured: {result.error} ({result.error_description}). Please try again: + An error occurred: {result.error} ({result.error_description}). Please try again.

) : null}
- } + ); } ``` @@ -112,13 +114,16 @@ export default function App() { if (isLoading) { return
Loading
} - else if (claims) { + + if (claims) { return (
         {JSON.stringify(claims, null, 2)}
       
) - } else { + } + + return ( {error ? (

@@ -127,13 +132,13 @@ export default function App() { ) : null} - } + ); } ``` ### Logging Out -`@criipto/verify-react` offers the logout method you can use to clear session storage and log out of any existing SSO session. +`@criipto/verify-react` offers the logout method you can use to clear session storage and log out of any existing SSO session. ```jsx const {logout} = useCriiptoVerify();