Skip to content

Commit 10480fd

Browse files
authored
update react quickstart to remove Authenticator reference from App.tsx (#8027)
* remove Authenticator ref from src/App.tsx * update code style
1 parent 8efcad1 commit 10480fd

File tree

1 file changed

+9
-10
lines changed
  • src/pages/[platform]/start/quickstart

1 file changed

+9
-10
lines changed

src/pages/[platform]/start/quickstart/index.mdx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,24 +567,23 @@ export const data = defineData({
567567
});
568568
```
569569

570-
In the application client code, let's also render the username to distinguish different users once they're logged in. Go to your **src/App.tsx** file and render the `user` property.
570+
In the application client code, let's also render the username to distinguish different users once they're logged in. Go to your **src/App.tsx** file and render the `user` property from the `useAuthenticator` hook.
571571

572572
```tsx title="src/App.tsx"
573573
// ... imports
574574

575575
function App() {
576+
// highlight-next-line
577+
const { user, signOut } = useAuthenticator();
578+
576579
// ...
580+
577581
return (
578-
<Authenticator>
582+
<main>
579583
// highlight-next-line
580-
{({ signOut, user }) => (
581-
<main>
582-
// highlight-next-line
583-
<h1>{user?.signInDetails?.loginId}'s todos</h1>
584-
{/* ... rest of the UI */}
585-
</main>
586-
)}
587-
</Authenticator>
584+
<h1>{user?.signInDetails?.loginId}'s todos</h1>
585+
{/* ... */}
586+
</main>
588587
)
589588
}
590589
```

0 commit comments

Comments
 (0)