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  Python code snippet - How to make a pygame window?

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.