0

I have a Star Icon, I need to display the Icon for 5 Times.. So this is what I did, I Imported that Icon and stored in one constant, After that I displayed 5 times in that Div......... But here I need to give Default value as 5 and Loop the Icon, Instead of displaying for 5 times.. Can anyone Help me in this, Thanks in Advance

Import {ReactComponet as Stars } from "assests/icons/star";
   
const starIcon = () => {
    const starIcon = <Stars />;
        
    return (
        <div>
            {starIcon } {starIcon } {starIcon } {starIcon } {starIcon }
        </div>
    )
}
sundeep
  • 355
  • 1
  • 3
  • 16

0 Answers0