How to Make a Mobile App with React, Ionic and Capacitor
Hi everyone, in this article we are going to make a mobile application using regular react code, we will use ionic framework for getting native ui fill of mobile application. Later we will use capacitor to give it a native wrapper, we can build for iOS , Android and Electron platform using the same. So let's start.
Prerequisites : Node.js should be installed, create-react-app should be installed globally, Xcode(for iOS) or Android Studio(for Android) should be installed.
For android platform final application will look like below.
If you don't have the settings install nodejs from nodejs.org.
Use command : npm i -g create-react-app@latest for installing create-react-app globally.
Let's initialise a create-react-app application instance with typescript template.
It will install all the dependencies required, then open the project in your preferred code editor, I am using VS code. Then install below dependencies.
Once they are installed you are good to go. Use npm run start command and you should see app is running properly.
Now let's replace the template code with following:
We will create pages folder within src, which will hold our basic header,footer and homepage files. You may rename it whatever you want. My project structure looks like below:
Header.js
Footer.js
Home.js
In this file I have downloaded two images, and placed them in public/images folder
And based on these changes we will update the App.js file, and wrap the whole thing with <IonApp>
Now our application is ready, use the command npm run start to test it in browser(chrome), if it is running successfully we will proceed creating the native wrapper with capacitor. My app looks like below :
So the application is running perfectly.
Next we will create the app wrapper using capacitor, first we will install the dependencies @capacitor/core and @capacitor/cli :
Now we have to build the react project, because build folder will be the base for the app. So use
'npm run build' to build the project.
Next, we need to initialise capacitor and give an app name. We will use "npx cap init" command and give an app name.
Then you will notice "capacitor.config.json" file is generated. Which looks like below.

The value of "webDir" key should be replaced with "build" as we will be using react build folder.

Now we need to add a platform iOS/Android or Electron, for this example I am using Andriod
Use command "npx cap add android"

Once the Android platform is setup use command "npx cap open android" , which will open up your Android Studio and building of app will start automatically
Note : If you are doing the same for first time, Android Studio might take a bit time to finish gradle sync.
Once the build process is successful, app will run on the emulator or your connected mobile device.
Finally once done and running app in emulator/device :
And the app is up and running ...
Hope this tutorial helps. Thank you for you time...
Used sample image sources :
https://www.bankinfosecurity.com/
kaspersky-new-tajmahal-apt-malware-enables-espionage-a-12365
https://www.independent.co.uk/travel/europe/
5-ways-to-experience-the-eiffel-tower-9214557.html
Prerequisites : Node.js should be installed, create-react-app should be installed globally, Xcode(for iOS) or Android Studio(for Android) should be installed.
For android platform final application will look like below.
If you don't have the settings install nodejs from nodejs.org.
Use command : npm i -g create-react-app@latest for installing create-react-app globally.
Let's initialise a create-react-app application instance with typescript template.
It will install all the dependencies required, then open the project in your preferred code editor, I am using VS code. Then install below dependencies.
Once they are installed you are good to go. Use npm run start command and you should see app is running properly.
Now let's replace the template code with following:
We will create pages folder within src, which will hold our basic header,footer and homepage files. You may rename it whatever you want. My project structure looks like below:
Header.js
import { IonHeader, IonTitle, IonToolbar } from '@ionic/react'; import React, { Component } from 'react'; class Header extends Component { render() { return ( <IonHeader> <IonToolbar color="primary"> <IonTitle>Travel Wishlist</IonTitle> </IonToolbar> </IonHeader> ); } } export default Header;
Footer.js
import { IonFooter, IonTitle, IonToolbar } from '@ionic/react'; import React, { Component } from 'react'; class Footer extends Component { render() { return ( <IonFooter> <IonToolbar> <IonTitle>Footer</IonTitle> </IonToolbar> </IonFooter> ); } } export default Footer;
Home.js
In this file I have downloaded two images, and placed them in public/images folder
import { IonCard, IonCardHeader, IonCardTitle, IonContent, IonButton, IonCardSubtitle, IonImg } from '@ionic/react'; import React, { Component } from 'react'; const Home = ()=> { return ( <IonContent> <IonCard> <IonImg src={process.env.PUBLIC_URL + '/images/1.jpg'} /> <IonCardHeader> <IonCardTitle>Taj Mahal</IonCardTitle> <IonCardSubtitle>Agra, Uttar Pradesh, India</IonCardSubtitle> </IonCardHeader> <ion-button expand="block" color="secondary">Read More</ion-button> </IonCard> <IonCard> <IonImg src={process.env.PUBLIC_URL + '/images/2.jpg'} /> <IonCardHeader> <IonCardTitle>Eiffel Tower</IonCardTitle> <IonCardSubtitle>Paris, France</IonCardSubtitle> </IonCardHeader> <ion-button expand="block" color="secondary">Read More</ion-button> </IonCard> </IonContent> ); } export default Home;
And based on these changes we will update the App.js file, and wrap the whole thing with <IonApp>
import '@ionic/core/css/core.css'; import '@ionic/core/css/ionic.bundle.css'; import { IonApp } from '@ionic/react'; import React, { Component } from 'react'; import Header from './pages/header' import Footer from './pages/footer' import Home from './pages/home' class App extends Component { render() { return ( <IonApp> <Header /> <Home /> <Footer /> </IonApp> ); } } export default App;
Now our application is ready, use the command npm run start to test it in browser(chrome), if it is running successfully we will proceed creating the native wrapper with capacitor. My app looks like below :
So the application is running perfectly.
Next we will create the app wrapper using capacitor, first we will install the dependencies @capacitor/core and @capacitor/cli :
Now we have to build the react project, because build folder will be the base for the app. So use
'npm run build' to build the project.
Next, we need to initialise capacitor and give an app name. We will use "npx cap init" command and give an app name.

The value of "webDir" key should be replaced with "build" as we will be using react build folder.

Now we need to add a platform iOS/Android or Electron, for this example I am using Andriod
Use command "npx cap add android"

Once the Android platform is setup use command "npx cap open android" , which will open up your Android Studio and building of app will start automatically
Note : If you are doing the same for first time, Android Studio might take a bit time to finish gradle sync.
Once the build process is successful, app will run on the emulator or your connected mobile device.
Finally once done and running app in emulator/device :
And the app is up and running ...
Hope this tutorial helps. Thank you for you time...
Used sample image sources :
https://www.bankinfosecurity.com/
kaspersky-new-tajmahal-apt-malware-enables-espionage-a-12365
https://www.independent.co.uk/travel/europe/
5-ways-to-experience-the-eiffel-tower-9214557.html













Great blog with good information.
ReplyDeleteIonic Online Course
Ionic Training in Chennai
Ionic Training in Bangalore
DC link capacitors When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your.
ReplyDeleteNice blog, it is very impressive.
ReplyDeleteReact Native Online Course
React Native Training in Chennai
React Native Training in Bangalore
Thanks for sharing this kind of information. This is really meant to me. Best react app development company in Australia
ReplyDeleteOur mobile app design and development company is tailored to meet your expectations and needs. We offer top-notch mobile app development.
ReplyDeleteNice blog, keep sharing with us.
ReplyDeleteFeatures of React Native
Scope of React Native
The details that you mentioned regarding mobile application development with the help of Ionic and react native is really great. I have gone through all the screenshots and the code also that you attached as sample and I believe that nothing could explain better than this.
ReplyDeleteI was searching for react native development company and got your blog.
Thanks sharing such a great blog.
Thanks for share your blog here . This is really meant to me.JPloft solutions
ReplyDeleteI am delighted to read your article here Creating Mobile App with React because you provide some excellent information which is incredibly helpful to me. Thank you for sharing it with us. Keep up the good work.
ReplyDeletePoker Game App Development Company
Thanks for sharing the useful information about Mobile App Development with Ionic. If you are looking for an Mobile App Development Company In India then you can go with Lucid Outsourcing Solutions.
ReplyDeleteI really enjoyed reading your blog. It was very well written and easy to understand. Unlike other blogs that I have read which are actually not very good. Thank you so much!
ReplyDeletesoftware development companies
Thank you very much for sharing this useful information. I was doing a project and for that I was looking for related information. Some of the points are very useful. Do share some more material if you have.
ReplyDeletewebsite development company
Connect Infosoft Technologies offers top-notch React Native development services that cater to the diverse needs of businesses. With our team of experienced developers, we deliver robust and scalable solutions that leverage the power of React Native framework. Whether you require a cross-platform mobile app or want to enhance your existing application, our experts can build custom React Native solutions tailored to your specific requirements. We follow industry best practices and stay updated with the latest trends to deliver high-quality apps that provide seamless user experiences across iOS and Android platforms.
ReplyDeleteGood Post. I really appreciate the efforts you put into compiling and sharing this piece of great content.
ReplyDeleteReact Native App Development Services
Thanks for sharing this blog. I must say that you have shared a valuable content that I am actually looking for. I want to share the list of react native app development company that can provide the best services.
ReplyDelete