mirror of
https://github.com/supabase/supabase.git
synced 2026-06-01 18:34:37 +08:00
chore(docs): turn on strictNullChecks (#36180)
strictNullChecks was off for docs, which lets errors slip through and leads to incorrect required/optional typing on Zod-inferred types. This PR enables strictNullChecks and fixes all the existing violations.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu'
|
||||
import type { ICommonItem } from '~/components/reference/Reference.types'
|
||||
import type { Json } from '~/features/helpers.types'
|
||||
@@ -52,7 +52,10 @@ export function deepFilterSections<T extends ICommonItem>(
|
||||
*
|
||||
* See https://webpack.js.org/api/module-methods/#dynamic-expressions-in-import
|
||||
*/
|
||||
export function useCommonSections(commonSectionsFile: string) {
|
||||
export function useCommonSections(
|
||||
commonSectionsFile: string,
|
||||
{ enabled = true }: { enabled: boolean }
|
||||
) {
|
||||
const [commonSections, setCommonSections] = useState<ICommonItem[]>()
|
||||
|
||||
useEffect(() => {
|
||||
@@ -67,6 +70,10 @@ export function useCommonSections(commonSectionsFile: string) {
|
||||
fetchCommonSections()
|
||||
}, [commonSectionsFile])
|
||||
|
||||
if (!enabled) {
|
||||
return null
|
||||
}
|
||||
|
||||
return commonSections
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user