/
githubmirror
/
gogs
Обзор
Документация
Войти
/
githubmirror
/
gogs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
web/src/lib/use-user-info.ts
12 строк
336 B
ᴊᴏᴇ ᴄʜᴇɴ
web: align components with React 19 and fix accessibility findings (#8306)
31 май 2026, 18:06
Не верифицирован
31 май 2026, 18:06
2c46f01
Код
Авторство
О чём код?
import { use } from "react"; import type { UserInfo } from "./user-info"; import { UserInfoContext } from "./user-info-context"; export function useUserInfo(): UserInfo | null { const ctx = use(UserInfoContext); if (ctx === undefined) { throw new Error("useUserInfo must be used within UserInfoProvider"); } return ctx; }