Output JSX From a Function Called by a React Component?

function displayStarRating(starRating){
    return starRating.map((index) => (
      <div key={index}>===STAR===</div>
    ) 
  }
}

class Reviews extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
        <div>
                {displayStarRating(4)}
        </div>
    );
  }
}