Hi team! just noticed a very minor thing on the ge...
# ask-a-descoper
l
Hi team! just noticed a very minor thing on the getting started section of the docs - https://docs.descope.com/build/guides/gettingstarted/
the sample App component, of the react example, needs a wrapper element (or Fragment), otherwise the jsx is not properly recognized:
Copy code
const App = () => {
    const { isAuthenticated, isSessionLoading } = useSession()
    const { user, isUserLoading } = useUser()
    const { logout } = useDescope()

    const handleLogout = useCallback(() => {
        logout()
    }, [logout])

    return (
        { !isAuthenticated &&
            (
              <Descope
                flowId="sign-up-or-in"
                onSuccess = {(e) => console.log(e.detail.user)}
                onError={(e) => console.log('Could not log in!')}
              />
            )
        }
  
        {
          (isSessionLoading || isUserLoading) && <p>Loading...</p>
        }

        { isAuthenticated &&
            (
              <>
                <p>Hello ${user.name}</p>
                <div>My Private Component</div>
                <button onClick={handleLogout}>Logout</button>
              </>
            )
        }
    );
}
b
Thanks for the note Kevin. Are you referring to our AppRoot wrapper, described in step 3 of the getting started guide?
Copy code
const AppRoot = () => {
    return (
        <AuthProvider
            projectId='<Project ID>'
        >
         <App />
        </AuthProvider>
    )
}
l
ahh i was referring to the App right below the AppRoot - I know it's just sample code, but i tend to copy paste directly, so it was a minor confusion that the code just didn't work out of the box
b
Ah. got it. makes sense. we will add. thanks for the feedback!
🙌 1