javascriptreactjsionic-frameworkionicons

'ionicons/icons' does not contain an export named 'star'


I am using ionic react to make an app. When I want to add IonIcon it says

'ionicons/icons' does not contain an export named 'star'


Here is my code

import { IonApp, IonButton, IonContent, IonFooter, IonHeader, IonIcon, IonTitle, IonToolbar } 
from '@ionic/react';
import React from 'react';
import { star } from 'ionicons/icons';
const Home = () => {

return (
    <IonApp>
        <IonHeader translucent>
    <IonToolbar>
      <IonTitle>Home</IonTitle>
    </IonToolbar>
  </IonHeader>
        <IonContent>
            <h3>Hello</h3>
        </IonContent>
        <IonFooter>
            <IonToolbar>
                <IonButton> <IonIcon icon={star}> </IonIcon> Home</IonButton> 
            </IonToolbar>
        </IonFooter>
    </IonApp>
);
};

export default Home;

Solution

  • I created the app firstly by npx creat-react-app then installed ionic-react on that. The icon was not showing on th file. But after creating an app by ionic start the icons are working fine.