I would like to make the child of GridList of react material-ui as component, However the child component does not get the style of maerial-ui. How can I make the React component inherit the GridList's style? my code as following:

const GridContain=(props)=>{
        return {tileData.map(tile => (
          <GridListTile key={tile.img}>
            <img src={tile.img} alt={tile.title} />
              subtitle={<span>by: {tile.author}</span>}
                <IconButton className={classes.icon}>
                  <InfoIcon />

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

  return (
    <div className={classes.root}>
      <GridList cellHeight={180} className={classes.gridList}>
        <GridListTile key="Subheader" cols={2} style={{ height: 'auto' }}>
          <ListSubheader component="div">December</ListSubheader>
        <GridContaint> //<<=== instead of the img, GridListTile, etc

export default (TitlebarGridList);

0 Answers