props.children

React props.children Как коллбэк, функция. Пример

Смотрите в документации тут: https://ru.reactjs.org/docs/jsx-in-depth.html#functions-as-children

Пример из документации:

// Вызывает колбэк numTimes раз для создания повторяющего компонента
function Repeat(props) {
  let items = [];
  for (let i = 0; i < props.numTimes; i++) {    items.push(props.children(i));
  }
  return <div>{items}</div>;
}

function ListOfTenThings() {
  return (
    <Repeat numTimes={10}>
      {(index) => <div key={index}>Это элемент списка с ключом {index}</div>}    </Repeat>
  );
}

react Пример компонента с закрывающим тегом

Например (в стиле хуков):

import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';


const styles = theme => ({
    formSection: {
        'margin-top': '20px',
    }
});

function FormSection(props) {
    const { classes } = props;

    return (
        <div className={classes.formSection}>
            {props.children} 
        </div>
    );
}

FormSection.propTypes = {
    classes: PropTypes.object.isRequired,
};

export default withStyles(styles)(FormSection);
Subscribe to RSS - props.children