🎁

12 Days of Baddass Courses sale! Get instant access to the entire egghead library of courses and lessons for 58% off.

Runs out in:
11 : 17 : 31 : 11
Join egghead, unlock knowledge.

Want more egghead? It's 58% off for a limited time only!

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock All Content for 40% Off
1×
Become a member
to unlock all features
Autoplay

    Create an Ionic 4 application with React

    Paul HallidayPaul Halliday
    reactReact
    ionicIonic

    Creating cross-platform web-based applications with Ionic 4 and React is easy thanks to the Stencil compiler and create-react-app.

    In this video, we look at how to use create-react-app and @ionic/react to make an Ionic 4 + React application

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Instructor: To create an Ionic 4 application with React, we can start off with a create-react-app application using typescript. Next up, we'll need to install ionic/react, ionic/core, and because Ionic 4 relies on the react-router, we'll also need that too, as well as the react-router-dom and the surrounding types.

    At this stage, we can now go ahead and import from ionic/react. To test the application works correctly, let's import the IonApp, the IonHeader, the IonToolbar, and the IonTitle components.

    The root of an Ionic app should be an IonApp component. Inside of that, we'll have an IonHeader, the header can have an IonToolbar, and the toolbar can have an IonTitle. We'll call it as Ionic and React.

    Finally, if we wanted to add content under the header, we need to import the IonContent. If we run our application with npm start, we can see our Ionic and React application on screen.