This article is about how to create your first mobile app using React Native and Expo. For the development, I used the online platform expo.dev. It accelerates your work by suggesting dependencies very well (which npm packages you need to install).
React Native is a JavaScript framework that helps you to launch your mobile app, similar to how React.js is used for building web applications. Like React.js, here also you create and call different components. Expo is basically a toolset for React Native — it provides pre-configured tools, libraries, and services so you don’t need to set up everything manually. Expo helps you make it easier and faster to build mobile apps (iOS and Android).
Steps
- Go to the expo.dev website. Opening this website you will find an interface like this, which is your first/main/directory root screen App.js.
If this interface does not open, then search for and go to the ‘Snacks’ section of expo.dev, where you can create a new Snack for your mobile app development.
2. In the file package.json, it stores the dependencies, which include different npm packages and libraries required to run the app.
3. If you want multiple screens in your app, then create another folder like screens and under this folder create different components like Sidebar.js, Layout.js, and LandingPage.js. Call these components in the App.js file as required. Similarly, you can call different components inside another component. In our case, Sidebar.js and Layout.js are called inside LandingPage.js, and LandingPage.js is then called inside the App.js screen.
You will see the output of your code on the right side of the expo.dev interface, where both Web and Android app previews are available. You can also scan the QR code from the device section using the Expo Go mobile app to run it directly on your device.
What I Learned
Building this first app taught me how simple it can be to get started with React Native when using Expo. The expo.dev platform and Expo Go app made testing very smooth, while React Native components helped me structure the app easily. This gave me the confidence to explore more features and build more complex apps in the future.
Visit Github