Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to pass children in react typescript

type Props = {
  title: string,
  children: JSX.Element,
};
const Page = ({ title, children }: Props) => (
  <div>
    <h1>{title}</h1>
    {children}
  </div>
);
Source by www.carlrippon.com #
 
PREVIOUS NEXT
Tagged: #pass #children #react #typescript
ADD COMMENT
Topic
Name
3+3 =