Home / Function/ useCommonSections() — supabase Function Reference

useCommonSections() — supabase Function Reference

Architecture documentation for the useCommonSections() function in NavigationMenu.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  d51d9ade_45a5_ae0a_ea9b_29cd40464dd5["useCommonSections()"]
  2e914397_cb19_9bde_039d_d6bf9de08beb["NavigationMenuRefList()"]
  2e914397_cb19_9bde_039d_d6bf9de08beb -->|calls| d51d9ade_45a5_ae0a_ea9b_29cd40464dd5
  style d51d9ade_45a5_ae0a_ea9b_29cd40464dd5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts lines 55–78

export function useCommonSections(
  commonSectionsFile: string,
  { enabled = true }: { enabled: boolean }
) {
  const [commonSections, setCommonSections] = useState<ICommonItem[]>()

  useEffect(() => {
    async function fetchCommonSections() {
      const commonSections = await import(
        /* webpackInclude: /common-.*\.json$/ */
        /* webpackMode: "lazy" */
        `~/spec/${commonSectionsFile}`
      )
      setCommonSections(commonSections.default)
    }
    fetchCommonSections()
  }, [commonSectionsFile])

  if (!enabled) {
    return null
  }

  return commonSections
}

Subdomains

Frequently Asked Questions

What does useCommonSections() do?
useCommonSections() is a function in the supabase codebase.
What calls useCommonSections()?
useCommonSections() is called by 1 function(s): NavigationMenuRefList.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free