Props3 / 12
Up next

children as ReactNode

import { ReactNode } from "react";

interface PanelProps {
  title: string;
  children: ReactNode;
}

function Panel({ title, children }: PanelProps) {
  return (
    <section>
      <h2>{title}</h2>
      {children}
    </section>
  );
}

export default Panel;
What you're solving

accept nested content via the children prop