Hey, everyone. My name is Mike Artington. I'm a developer at Ionic, and I want to talk to you about bringing Ionic over to React, and then go over some of the fun challenges that we faced along the way. If you have any questions, feel free to reach out afterwards.
For those who don't know, Ionic is a framework for building cross-platform apps using HTML, CSS and JavaScript. You write your app using our components, and you get a native iOS, native Android or desktop app, or progressive web app, all from the same code base. Roughly 20% of all the apps in the app stores are using Ionic to some degree.
Now, that is kind of a vanity metric. Doesn't really mean anything. Just that people are using Ionic and having a lot of success. As well as being used inside of the app stores, there's millions of developers all around the world using Ionic today and being very successful.
Now, a little history lesson. Ionic had been historically tied to one specific framework from it's very beginning. And as frameworks kind of come and go, and JavaScript as an ecosystem matures, we constantly heard from our developers that they wanted to use more than just that one framework. And to be honest, we were interested in seeing, can we bring Ionic to other frameworks as well? But we constantly were afraid of having to build we were afraid of having to rewrite our components to yet another framework that could or could not last for the next five years.
Now, fast forward to last year in 2019, Ionic had had years of stable releases. And JavaScript as an ecosystem had matured to a point where there was a lot less churn through different frameworks and different standards. And we were feeling pretty ambitious that we could create another binding for a different framework and support something more than just what we were historically tied to. So in about six months time, we ended up creating an entire collection of React components based on our original Ionic component set. These were all components that you can import and add into your standard React project and followed React best practices internally for how to manage component state and provide all the different interactions that people would expect. More interestingly, we were able to integrate with React Router and start to create a higher order component that could create animations and transitions automatically for you without developers having to wire that up themselves. Now, that leads us to Ionic React, which has hit its stable release a few months ago, but brings Ionic to even more developers out there. So, let's take a look at what Ionic React looks like. Here in my editor, I just have a standard React project, and I'm going to open up my root app component. Now, we have a collection of different components that we are importing from Ionic React, as well as a wrapper for React Router and our various components that we can route to. We also include the core Ionic CSS, as well as our own custom theme in variables.css. Now, further down in our app, we have our core app component with a Ion Router Outlet, which acts as a placeholder for all of our different routes. For example, we could route to tab one, tab two, tab two slash detail, as well as tab 3. We can wire up how we route to those components by looking at the different tab buttons inside of our app. So let's open up one of the components for this tab interface.
Comments