Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

More console warnings

Terry Sutton7d27671e4971
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx
index 8017146442b..cfb4d87b143 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx
@@ -62,7 +62,7 @@ export type RefKeyOptions =
| 'self-hosting-storage'
| 'self-hosting-realtime'
-const NavigationMenu = ({ context }) => {
+const NavigationMenu = () => {
const router = useRouter()
let version = ''
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx
index f298683984d..e4e73a8e132 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx
@@ -137,7 +137,14 @@ const ContentLink = React.memo(function ContentLink(props: any) {
: 'hover:text-brand-900 text-scale-1000',
].join(' ')}
>
- {props.icon && <img className="w-3" src={`${router.basePath}${props.icon}`} />}
+ {props.icon && (
+ <Image
+ alt={props.icon}
+ width={12}
+ height={12}
+ src={`${router.basePath}${props.icon}`}
+ />
+ )}
{props.name}
</a>
</Link>
@@ -177,14 +184,15 @@ const Content = (props) => {
</a>
</Link>
- {menu.items.map((x, index) => {
+ {menu.items.map((x) => {
return (
- <div key={x.url}>
+ <div key={x.name}>
{x.items && x.items.length > 0 ? (
<div>
{x.items.map((subItem, subItemIndex) => {
return (
<ContentAccordionLink
+ key={subItem.name}
subItem={subItem}
subItemIndex={subItemIndex}
parent={x}
@@ -193,7 +201,7 @@ const Content = (props) => {
})}
</div>
) : (
- <ContentLink url={x.url} icon={x.icon} name={x.name} />
+ <ContentLink url={x.url} icon={x.icon} name={x.name} key={x.name} />
)}
</div>
)
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx
index fd87508d468..87a90b82baa 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx
@@ -12,8 +12,9 @@ import RevVersionDropdown from '~/components/RefVersionDropdown'
import { useMenuActiveRefId } from '~/hooks/useMenuState'
import { RefIdOptions, RefKeyOptions } from './NavigationMenu'
-import React from 'react'
+import React, { Fragment } from 'react'
import { generateAllowedClientLibKeys } from '~/lib/refGenerator/helpers'
+import { isFuncNotInLibraryOrVersion } from './NavigationMenu.utils'
const HeaderImage = React.memo(function HeaderImage(props: any) {
const router = useRouter()
@@ -131,6 +132,7 @@ const RenderLink = React.memo(function RenderLink(props: any) {
.map((item) => {
return (
<FunctionLink
+ key={item.title}
library={props.lib}
title={item.title}
id={item.id}
@@ -245,76 +247,56 @@ const Content: React.FC<INavigationMenuRefList> = ({ id, lib, commonSections, sp
<ul className="function-link-list">
{sections.map((fn: any, fnIndex) => {
- //
- // check if the link is allowed to be displayed
- function isFuncNotInLibraryOrVersion(id, type) {
- if (id && allowedKeys && !allowedKeys.includes(id) && type !== 'markdown') {
- /*
- * Remove this menu link from side bar, as it does not exist for either
- * this language, or for this lib version
- *
- * */
- return true
- } else {
- return false
- }
- }
-
// run allow check
- if (isFuncNotInLibraryOrVersion(fn.id, fn.type)) {
- return <></>
+ if (isFuncNotInLibraryOrVersion(fn.id, fn.type, allowedKeys)) {
+ return <Fragment key={fn.id}></Fragment>
}
// handle subtitles with subitems
- if (!fn.id) {
- return (
- <>
- <Divider />
- <SideMenuTitle title={fn.title} />
- {fn.items &&
- fn.items
- //.filter((item) => item.libs && item.libs.includes(lib))
- .map((item) => {
- // run allow check
- if (isFuncNotInLibraryOrVersion(item.id, item.type)) return <></>
- return (
- <RenderLink
- {...item}
- library={menu.title}
- index={fnIndex}
- modifierIds={modifierIds}
- filterIds={filterIds}
- authServerIds={authServerIds}
- lib={lib}
- allowedKeys={allowedKeys}
- />
- )
- })}
- </>
- )
- } else {
- // handle normal links
- return (
- <>
- <RenderLink {...fn} lib={lib} />
- {fn.items &&
- fn.items
- //.filter((item) => item.libs.includes(lib))
- .map((item) => (
- <RenderLink
- {...item}
- library={menu.title}
- index={fnIndex}
- modifierIds={modifierIds}
- filterIds={filterIds}
- authServerIds={authServerIds}
- lib={lib}
- allowedKeys={allowedKeys}
- />
- ))}
- </>
- )
- }
+ return fn.id ? (
+ <Fragment key={fn.id}>
+ <RenderLink {...fn} lib={lib} />
+ {fn.items &&
+ fn.items
+ //.filter((item) => item.libs.includes(lib))
+ .map((item) => (
+ <RenderLink
+ {...item}
+ library={menu.title}
+ index={fnIndex}
+ modifierIds={modifierIds}
+ filterIds={filterIds}
+ authServerIds={authServerIds}
+ lib={lib}
+ allowedKeys={allowedKeys}
+ />
+ ))}
+ </Fragment>
+ ) : (
+ <Fragment key={fn.title}>
+ <Divider />
+ <SideMenuTitle title={fn.title} />
+ {fn.items &&
+ fn.items.map((item, i) => {
+ // run allow check
+ if (isFuncNotInLibraryOrVersion(item.id, item.type, allowedKeys))
+ return <Fragment key={item.id + i}></Fragment>
+ return (
+ <RenderLink
+ {...item}
+ key={item.id + i}
+ library={menu.title}
+ index={fnIndex}
+ modifierIds={modifierIds}
+ filterIds={filterIds}
+ authServerIds={authServerIds}
+ lib={lib}
+ allowedKeys={allowedKeys}
+ />
+ )
+ })}
+ </Fragment>
+ )
})}
</ul>
</div>
diff --git a/apps/docs/pages/guides/functions.mdx b/apps/docs/pages/guides/functions.mdx
index fdceb0ceea9..9c970cb6bfe 100644
--- a/apps/docs/pages/guides/functions.mdx
+++ b/apps/docs/pages/guides/functions.mdx
@@ -29,7 +29,7 @@ Check out the [Edge Function Examples](https://github.com/supabase/supabase/tree
<div className="grid md:grid-cols-12 gap-4 not-prose">
{examples.map((x) => (
- <div className="col-span-4">
+ <div className="col-span-4" key={x.href}>
<Link href={x.href} passHref>
<a>
<GlassPanel icon={'/docs/img/icons/github-icon'} hasLightIcon={true} title={x.name}>