Need help in converting react native to ionic

Hi guys,

I am working on a college project to create a basic LMS android app in ionic framework and an iOS app in swift. I somehow managed to get the source of an react native with required functionality.

Now, I want to convert react native app into ionic. Is this possible without starting from scratch?

1 Like

It’s better to write it from scratch in Ionic if it’s a learning project. You could convert from React Native, but then you’ll be bringing over a lot of patterns that you don’t necessarily need if you’re designing from scratch in Ionic/regular React. Routing works a lot differently, and you have capacitor for native functionality in Ionic, so I would start by planning out the features you need and then implement them based on the Ionic starter app.

Makes sense. I will start development from scratch but as I am a complete beginner- can you please recommend me any tutorial or guide to learn things in a better way?

Secondly, I might also need to create a native iOS app with similar functionality.

Everyone is recommending to learn swift for iOS app but as you said, Capacitor can be used for native functionality, so my question is, how can I build a native iOS app with ionic?

Capacitor with Ionic React lets you write a React app with Ionic components, and then use Capacitor to access native functionality like push notifications and in-app purchases.

However, it will look different than an app built with Swift– for example, there’s no liquid glass in capacitor. But many things you can do in Swift you can do just as well in capacitor (games would be a big exception).

On the other hand, if you really needed it to be a “native” app, you could use React Native instead of Swift. There’s a lot of options.

At the beginning, I think Ionic React / Capacitor is a good choice because they’re built on open web standards, and they’ll encourage you to build in an open, standards-oriented way.

I don’t have specific tutorials to recommend but because Ionic React is basically React with Ionic components, you can use any React tutorial to learn the basics; to use the Ionic components, you just import them in React, so there’s a very low learning curve.

2 Likes

Great, thanks for the guidance. I will build these apps on ionic.

My android app development is going smoothly but recently, our professor made an announcement that iOS app should be developed on swift. So, I started learning swift as well and got blocked midway as I am unable to run XCode on my windows laptop and I can’t afford a MacBook right now. Do you have any solution for it?

With Ionic, if you don’t have a Mac, you can build the app in the cloud with something like GitHub Actions (you will have to set this up yourself).

GitHub actions lets you run actions on a macOS computer and includes XCode. So if you only need to deploy the app, you can build in the cloud, but all debugging will have to happen locally. Usually this costs money but you get 2,000 minutes a month for free with any GitHub account, which should be enough to build an iOS app several times.

…But it won’t use Swift, it will be capacitor.

If you really need to use Swift, I would ask your instructor what you’re supposed to do. In the classes I’ve taken in my life, the instructor explains the tools you need to do the tasks assigned in class; if having a mac is not a requirement for the course, the course should be providing some solution to submit the assignment.

3 Likes

Gotta love Apple’s closed ecosystem forcing you to buy a Mac… We used macincloud.com for a while before getting our own Mac Mini. But, if this is just for a class, I would hope they would offer something for students who don’t own a Mac.

1 Like

I don’t know. I am the only one in the class with a windows, everyone already started working on their apps. Today, my professor has given me a method and somehow I got things working on my windows system. I will definetly try Github action as well.

macincloud.com looks very good option but I don’t think so I can manage its cost right now.

Actually, I am the only once with windows in my class and today, they have given me a method that I shared above and it’s working pretty well right now. Let’s hope it works the same in future as well.

It’s better to start from scratch in Ionic rather than converting React Native. Use a starter app, plan your features, and build with Ionic components. Capacitor gives access to native functionality for Android and iOS. Learn React for the basics and then add Ionic components. Swift is only needed for fully native iOS apps.