import React, { useMemo, useState, useLayoutEffect, type ReactNode } from "react" import { Text } from "ink" type Styles = any export type Props = { readonly items: T[] readonly style?: Styles readonly children: (item: T, index: number) => ReactNode } export default function Static(props: Props) { const { items, children: render, style: customStyle } = props const [index, setIndex] = useState(0) const itemsToRender: T[] = useMemo(() => { return items.slice(index) }, [items, index]) useLayoutEffect(() => { setIndex(items.length) }, [items.length]) const children = itemsToRender.map((item, itemIndex) => { return Hello world }) const style: Styles = useMemo( () => ({ position: "absolute", flexDirection: "column", ...customStyle, }), [customStyle], ) const Comp = "ink-box" as any return ( Hello world ) }