Polymorphic Сomponents
export default function Polymorphic({as, children, ...rest}: any) { const Component = as || "span";
return <Component {...rest}>{children}</Component>}
// ...rest {...rest} - Добавляет вобзможность вставлять кастомные элементы
import Polymorphic from "@/components/_corecss/polymorphic";
export default function Page() { return ( <Polymorphic as='a' href="https://fubon.ru" target='_blank'>Polymorphic Сomponents</Polymorphic> )}