docs: DX and performance improvements in API reference (#9430)

- Improve scroll behavior between active sections
- Improve lag when clicking on a sidebar item
- Refactor internal working of the `SidebarProvider` to find active items faster.
- Use Next.js's `useRouter` hook for changing the hash (since they added the option to disable scroll)
- Change `isBrowser` from a hook to a provider since it's widely used across applications.
- Other general improvements and fixes.

Closes DOCS-952
This commit is contained in:
Shahed Nasser
2024-10-02 15:51:02 +00:00
committed by GitHub
parent 5fb9c1f82e
commit 0f6f56e764
38 changed files with 294 additions and 218 deletions
@@ -0,0 +1,25 @@
"use client"
import React from "react"
import {
BrowserProvider,
ColorModeProvider,
MobileProvider,
ModalProvider,
} from "../../providers"
type RootProvidersProps = {
children: React.ReactNode
}
export const RootProviders = ({ children }: RootProvidersProps) => {
return (
<BrowserProvider>
<MobileProvider>
<ColorModeProvider>
<ModalProvider>{children}</ModalProvider>
</ColorModeProvider>
</MobileProvider>
</BrowserProvider>
)
}