umma.dev

Using Ionic with React

Ionic is a cross-platform UI component library for both the web and mobile. Ionic recently released a stable version for React.

Setting up Ionic

  • Install Ionic on your machine

    npm install -g ionic@latest

Build an Ionic Project with React

  • Head over to your terminal and type the following command

iconic start <app-name> --type=react

  • You will then be asked to pick a template, choices include blank, sidemenu, tabs and conference

  • Move into your app project folder

cd <app-name>

  • Fire up the server to view your app

ionic serve

Ionic Features

  • Ionic uses TypeScript - if you prefer to use JavaScript, you can change file extensions to .js

  • All the components are functional

  • The IonReactRouter is a wrapper around the React Router BrowserRouter