Skip to content

Commit

Permalink
testing out useUser
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekradko committed Nov 21, 2024
1 parent 6cc8a95 commit 0c99e5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import {
SignedOut,
UserButton,
} from '@clerk/clerk-react';
import UseUser from './UseUser';

function App() {
export default function App() {
return (
<header>
<UseUser />
<SignedOut>
<SignInButton />
</SignedOut>
Expand All @@ -17,5 +19,3 @@ function App() {
</header>
);
}

export default App;
14 changes: 14 additions & 0 deletions src/UseUser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { useUser } from '@clerk/clerk-react';

export default function UseUser() {
const { isSignedIn, isLoaded } = useUser();

return (
<div>
<span>isSignedIn: {isSignedIn?.toString()}</span>
<br />
<span>isLoaded: {isLoaded?.toString()}</span>
<br />
</div>
);
}

0 comments on commit 0c99e5d

Please sign in to comment.