docs: update to next 15 + eslint 9 (#9839)
* update next * updated react * update eslint * finish updating eslint * fix content lint errors * fix docs test * fix vale action * fix installation errors
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
"use client"
|
||||
|
||||
import React, { useMemo } from "react"
|
||||
import React from "react"
|
||||
import { CollapsibleReturn } from "../../../../hooks"
|
||||
|
||||
export type CodeBlockCollapsibleLinesProps = {
|
||||
@@ -12,18 +10,13 @@ export const CodeBlockCollapsibleLines = ({
|
||||
children,
|
||||
type,
|
||||
collapsed,
|
||||
getCollapsibleElms,
|
||||
}: CodeBlockCollapsibleLinesProps) => {
|
||||
const shownChildren: React.ReactNode = useMemo(() => {
|
||||
const isStart = type === "start"
|
||||
return (
|
||||
<>
|
||||
{collapsed && Array.isArray(children)
|
||||
? children.slice(isStart ? -2 : 0, isStart ? undefined : 2)
|
||||
: children}
|
||||
</>
|
||||
)
|
||||
}, [children, collapsed])
|
||||
|
||||
return getCollapsibleElms(shownChildren)
|
||||
const isStart = type === "start"
|
||||
return (
|
||||
<>
|
||||
{collapsed && Array.isArray(children)
|
||||
? children.slice(isStart ? -2 : 0, isStart ? undefined : 2)
|
||||
: children}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useColorMode } from "@/providers"
|
||||
import { CodeBlockHeader, CodeBlockHeaderMeta } from "./Header"
|
||||
import { CodeBlockLine } from "./Line"
|
||||
import { ApiAuthType, ApiDataOptions, ApiMethod } from "types"
|
||||
// @ts-expect-error can't install the types package because it doesn't support React v19
|
||||
import { CSSTransition } from "react-transition-group"
|
||||
import { useCollapsibleCodeLines } from "../.."
|
||||
import { HighlightProps as CollapsibleHighlightProps } from "@/hooks"
|
||||
|
||||
Reference in New Issue
Block a user