Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Lightning-Fast Mobile App Development with Galio
Lightning-Fast Mobile App Development with Galio

Lightning-Fast Mobile App Development with Galio: Build stylish cross-platform mobile apps with Galio and React Native

Arrow left icon
Profile Icon Gheorghe
Arrow right icon
NZ$56.99
Paperback Nov 2021 272 pages 1st Edition
eBook
NZ$31.99 NZ$45.99
Paperback
NZ$56.99
Subscription
Free Trial
Arrow left icon
Profile Icon Gheorghe
Arrow right icon
NZ$56.99
Paperback Nov 2021 272 pages 1st Edition
eBook
NZ$31.99 NZ$45.99
Paperback
NZ$56.99
Subscription
Free Trial
eBook
NZ$31.99 NZ$45.99
Paperback
NZ$56.99
Subscription
Free Trial

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Lightning-Fast Mobile App Development with Galio

Chapter 2: Basics of React Native

We started by learning about why React Native and Galio form the best combination for us to start building our first cross-platform mobile application. After setting up our environment and configuring the necessary files, we created our first React Native project with Expo and we learned about the different ways we can test the app both physically and digitally.

I believe that learning about the whys before the hows helps build a better, more robust knowledge base. Having passed through the whys, it is now time to learn about how React Native works and how to use it to create our apps.

That is why we'll start this chapter by going through the file structure of our React Native project for us to understand how these files and folders are connected. We'll then go through the App.js file and explain how this works for us as the main entry point into our application.

Once we've learned about the file structure, it is time for us to learn about what JSX is and how to use it – the skeleton of any React application. We'll be comparing JSX to HTML a lot, so you'll have to know a bit of HTML beforehand. Rest easy if you don't know much about web development – we'll lay down some HTML concepts as well, but learning a bit about it on your own may help you a lot in the long run. Understanding the concept of JSX is where we'll deal with the concept of components, a concept we barely touched on in the first chapter. This should be completely understood by the end of this chapter.

Once we've understood the main concepts of JSX and how it is connected to React and React Native, we'll do our first component import. We'll learn what npm/yarn is and how to use it for importing and uploading components or libraries on the web. This is exciting as you'll see the importance of having a huge community backing a framework and how you can participate and make new friends.

It is now time to learn about the core components of React Native. We'll understand how and in which contexts they're useful while we discuss different ways of improving them or even changing them completely. The core components are the base components for all the components we'll find online. That means that almost every component inherits from the core ones, which makes them important to learn about and understand.

By the end of this chapter, you'll have learned how to build a component. You'll have also learned how to use it in our app or future apps and how to organize the files so that you'll never get lost searching for your components.

I believe that by the end of this chapter, you will be able to start building really simple apps that can serve as a stepping stone for building bigger, more complex projects. Understanding these concepts doesn't stop at reading this book – it goes further than that, and you'll see me always encouraging you to check out the official documentation of whatever project/framework we're using as the documentation should always be something a programmer should feel comfortable reading. Learning to read the documentation is a skill you'll develop in time by reading and being as interested as possible in the project you're passionate about.

This chapter will cover the following topics:

  • Using App.js – the main entry point
  • Understanding the concept of JSX
  • Importing your first component
  • Core components
  • Understanding and creating a component

Technical requirements

You can check out this chapter's code by going to GitHub at https://github.com/PacktPublishing/Lightning-Fast-Mobile-App-Development-with-Galio. You'll find a folder called Chapter 02 that contains all the code we've written inside this chapter. To use that project, please follow the instructions in the README.md file.

Using App.js – the main entry point

As we know, React Native is an open source framework used for building iOS and Android applications. It uses React to describe the UI while accessing the platform's capabilities through the methods we have at our disposal.

Understanding our folder structure is important because we're not supposed to touch some of the files– at least at the beginning of our development. Let's take a look at our newly created project's structure.

Tip

Don't forget that you can use any text editor you want to; I'm only using VSCode because I like the way it looks and it has lots of plugins that I use, but that doesn't mean you can't open up the project with whatever text editor you feel comfortable with. Of course, that'll mean you won't be able to use the code. command as that's only used for VSCode.

First, let's open our Terminal and navigate to our folder. Now, if we write code. once we get to the folder, it will open Visual Studio Code.

Once our text editor has opened, we will see the following output in the project directory:

Figure 2.1 – Project directory once you open the text editor

Figure 2.1 – Project directory once you open the text editor

As we can see, there are several folders and files here and they're all meant to help bundle the project once you finish your app. We'll look at each of these folders in the next few sections.

The .expo and .expo-shared folders

We'll start with the folders with a dot in front of them: .expo and .expo-shared. The dot is there to show a hidden file. That's a file you can't see directly while opening the file browser; you can only see it if you specifically choose to see it. Such files are hidden because you don't need to touch them. They're config files that are created when you first use the expo start command.

The assets folder

The next folder is the assets folder. Inside, you'll find several .png images, which are used by Expo for the splash screen – the screen that appears while the app is loading – and icons for the app to use when it's installed on a device.

The node_modules folder

Now, you'll see a folder called node_modules. If you open that folder, you'll be able to see lots and lots of folders. All these folders are packages and dependencies that we're using to make this app work. Everything that you're installing or bringing in from over the internet is going to go straight into this folder. This folder is going to get bigger and bigger, depending on how many external packages you'll be using for your app.

Once we get past these folders, we've got some files with some interesting features.

The files within

First, we can see .gitignore, which helps us save size when uploading on GitHub. If you open the file, you'll see there's already some text written in it. Everything you see in there will be ignored once you upload your project on GitHub. You'll find that .expo is there because those folders are only relevant for the programmer and they're not intended for sharing. You can edit this file by using any filename you don't want to move over to online or you don't intend on changing.

Important Note

GitHub is a platform that acts like an internet hosting company for open source software programs while also providing the programmer with version control using Git. Developers are using Git to track changes in their projects and coordinating with their teammates.

For now, we'll ignore App.js because we'll explain this file at the end of this section. So, let's go directly to the app.json file. This file acts like a config file for your app – basically, everything that's not code-related will be found there. Let's say, for example, we want to change the image of our splash screen. We don't have any way of doing that besides going into this file and editing the splash image's path. From here, you can change almost everything related to your application, such as the icon or its orientation. You'll see yourself going there quite a lot, configuring your app for the final release version.

We don't care about babel.config.js but I'm pretty sure you'd be curious about that one as well. Babel is a JavaScript compiler almost everyone is using to get access to the latest standards of JavaScript. It's not necessary to edit this file but if you want to learn more about compilers, I recommend searching for more information about Babel.

The last two files are package-lock.json and package.json. The first one always gets created when you're using npm to install dependencies in your project. I've already told you that we'll learn about npm in this chapter, but not right now. Right now, I want you to become familiar with all the files in the project directory. By creating your app via the command line, Expo automatically used npm to bring lots of files you'd use in your project over the internet. Those files are stored in the node_modules folder. You can find out more about all the direct dependencies that you're using in package.json.

Now that we've finally got to the end of all the files, we should start talking about App.js. So, let's open that file and take a look at it.

The App.js file

Upon opening the App.js file, you will see the following:

Figure 2.2 – Code in the App.js file

Figure 2.2 – Code in the App.js file

You can immediately see the Open up App.js to start working on your app! text. I'm pretty sure you remember but in the previous chapter, when we tested our app, this was the text that appeared on the center of the screen. This means that by changing the text, we should also see a change in our app.

We won't do that right now as our focus is understanding the files and code, and then changing it to our liking.

I'm pretty sure you connected the dots after seeing this file and realized that this is the entry point of our app. An entry point is the main file that connects all the files and starts the application. Our main function for using Expo is the App() function. Your entire application will be living inside that function.

The reason you saw the centered text when you opened the app was because the text is inside the App() function. Here, we'll start building our app. For that to happen, we must understand what JSX is and how to use it inside our app. I'm assuming you can already read a bit of JavaScript and you understand notions such as functions and objects; we won't be covering this topic in this book. We'll get to grips with JSX in the next section.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand Galio and quickly build cross-platform mobile apps
  • Discover how to put Galio into practice by implementing it in real-world scenarios
  • Build beautiful apps using Galio by taking advantage of its carefully crafted components

Description

Galio is a free open source React Native framework that enables beginner-level programmers to quickly build cross-platform mobile apps by leveraging its beautifully designed ready-made components. This book helps you to learn about React Native app development while building impressive out-of-the-box apps with Galio. Lightning Fast Mobile App Development with Galio takes a hands-on approach to implementation and associated methodologies that will have you up and running and productive in no time. Complete with step-by-step explanations of essential concepts, practical examples, and self-assessment questions, you will begin by exploring the basics of React Native and understanding how Galio works. As you make progress, you'll learn how to initialize and configure a React Native app and get to grips with the basics of React Native development. You'll also discover how packages work and how to install Galio as the main dependency, along with understanding how and why Galio helps you to develop apps with ease. Finally, you'll build three practical and exciting apps using React Native and Galio. By the end of this app development book, you'll have learned how to use Galio to quickly create layouts and set up React Native projects for your personal ideas.

Who is this book for?

This book is for developers who are looking to learn new skills or build personal mobile apps. Anyone trying to change their job as well as beginners and intermediate web developers will also find this book useful. A basic understanding of CSS, HTML, and JavaScript is needed to get the most out of this book.

What you will learn

  • Explore Galio and learn how to build beautiful and functional apps
  • Familiarize yourself with the Galio ecosystem
  • Discover how to use npm and understand why Galio is needed
  • Get to grips with the basics of constructing a basic but attractive UI for an app
  • Find out how you can utilize Galio s ready-made components
  • Use Galio to drive the process of quickly building cross-platform mobile apps
  • Build three practical and exciting apps with React Native and Galio
Estimated delivery fee Deliver to New Zealand

Standard delivery 10 - 13 business days

NZ$20.95

Premium delivery 5 - 8 business days

NZ$74.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 02, 2021
Length: 272 pages
Edition : 1st
Language : English
ISBN-13 : 9781801073165
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to New Zealand

Standard delivery 10 - 13 business days

NZ$20.95

Premium delivery 5 - 8 business days

NZ$74.95
(Includes tracking information)

Product Details

Publication date : Nov 02, 2021
Length: 272 pages
Edition : 1st
Language : English
ISBN-13 : 9781801073165
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 260.97
Modern DevOps Practices
NZ$80.99
Lightning-Fast Mobile App Development with Galio
NZ$56.99
React and React Native
NZ$122.99
Total NZ$ 260.97 Stars icon

Table of Contents

13 Chapters
Chapter 1:Introduction to React Native and Galio Chevron down icon Chevron up icon
Chapter 2: Basics of React Native Chevron down icon Chevron up icon
Chapter 3: The Correct Mindset Chevron down icon Chevron up icon
Chapter 4: Your First Cross-Platform App Chevron down icon Chevron up icon
Chapter 5: Why Galio? Chevron down icon Chevron up icon
Chapter 6: The Basics of Mobile UI Building Chevron down icon Chevron up icon
Chapter 7: Exploring the State of Our App Chevron down icon Chevron up icon
Chapter 8: Creating Your Own Custom Components Chevron down icon Chevron up icon
Chapter 9: Debugging and Reaching out for Help Chevron down icon Chevron up icon
Chapter 10: Building an Onboarding Screen Chevron down icon Chevron up icon
Chapter 11: Let's Build – Stopwatch App Chevron down icon Chevron up icon
Chapter 12: Where To Go from Here? Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela