Skip to content

Commit

Permalink
docs: add state-management.md
Browse files Browse the repository at this point in the history
  • Loading branch information
h-takeyeah committed Mar 30, 2024
1 parent 3b08eb6 commit 015c9dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions typing-app/docs/state-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 状態管理
## ログイン状態

- ログインしているかどうか判断したいとき

```tsx
"use client";
import { useUser } from "@/state";

export function LoginStatus() {
const user = useUser()

return <div>User is{user ? " " : " not "}logged in!</div>
}
```

0 comments on commit 015c9dd

Please sign in to comment.