Skip to content

TypeScript code snippet – How to pass children in react ?

type Props = {
  title: string,
  children: JSX.Element,
};
const Page = ({ title, children }: Props) => (
  <div>
    <h1>{title}</h1>
    {children}
  </div>
);
See also  How to delete a particular element from a list in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.