mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: improve TypeScript handling and add build configuration for type safety
This commit is contained in:
parent
1b8c7730cb
commit
93dc16713b
3 changed files with 29 additions and 6 deletions
|
|
@ -10,9 +10,11 @@ export default function AuthLayout({
|
|||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
// Use optional chaining with proper typing to fix build error
|
||||
const searchParams = useSearchParams()
|
||||
// Use optional chaining and nullish coalescing for type safety
|
||||
const orgslug = searchParams?.get('orgslug') ?? null
|
||||
// Type-safe approach to getting optional params
|
||||
const orgslug = searchParams ? searchParams.get('orgslug') : null
|
||||
|
||||
if (orgslug) {
|
||||
return <OrgProvider orgslug={orgslug}>{children}</OrgProvider>
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue