Components & JSX8 / 14
Up next

Children prop

import { ReactNode } from "react";

// children lets a component wrap arbitrary content
function Card({ children }: { children: ReactNode }) {
  return <div className="card">{children}</div>;
}

export default Card;
What you're solving

compose components by passing children