props.children - text between component's opening and closing tag

PHOTO EMBED

Mon Jan 17 2022 10:25:21 GMT+0000 (UTC)

Saved by @KarenStewart #react.js

<Welcome>Hello world!</Welcome>



function Welcome(props) {
  return <p>{props.children}</p>;
}
content_copyCOPY

props.children props.children is available on every component. It contains the content between the opening and closing tags of a component. The string Hello world! is available in props.children in the Welcome component: