Building Car Parking Finder App UI Clone in React Native # 1: Map View
Tags: reactnative, reactnativecarpark, reactnativelayout, carparkingapp
Published: 2019-10-22 02:47:36

---
title: Building Car Parking Finder App UI Clone in React Native # 1: Map View
published: true
date: 2019-10-22 02:33:47 UTC
tags: React native,React native Carpark,React native Layout,carparking app
canonical_url: https://kriss.io/react-native-car-parking-finder-app-ui-clone-1-map-view/
cover_image: https://kriss.io/wp-content/uploads/2019/10/React-native-layout-carparking-app.png
---

This Car Parking Finder App UI clone tutorial series was inspired by the [Store Locator App template](https://www.instamobile.io/app-templates/react-native-store-locator-app-template/?ref=4094&campaign=dev.to) that provides us with a dynamic, fully-coded starter kit written in React Native that anyone can use to build their own store locator React Native application or initiate their own startup.

This tutorial replicates the coding implementations and designs from the Youtube video tutorial by [React UI Kit](https://www.youtube.com/watch?v=WbCthBwMxQc&list=PLNRPou200YIeu4UllJkv8-Ca19Ld_eOay&index=9) for the Car Parking Finder App UI Clone. The video tutorial is delivered using speed coding with quick implementations which may be difficult for any developer to comprehend. Therefore, the video tutorial is not made for beginners as it does not explain any details of the code. So in order to make things easier and clearer, this tutorial series breaks down the video into different sections. It also provides step by step guide to implement each UI section of the app. This will make things easier for anyone especially the beginners.

### Overview

In this first part of this tutorial series, we are going to implement the map view as well as divide the map view screen into different UI sections for upcoming tutorial parts. This first part basically lays out the foundation for upcoming parts of this tutorial series so that it will become easier later on. Here, the idea is to start with a new React Native starter project using expo. Then, we will begin by implementing the map view. After that, we will divide the UI sections of the map screen.

_So, let us begin!!_

_ **Note that, in this tutorial, we are going to use the EXPO as the React Native project development tool. So first, we are going to create a boilerplate React Native application using expo client.** _

 

## Creating Starter React Native project

First and foremost, since we are going to use the expo as a development engine, we need to install it into our system. To install expo globally into our system, we need to have Node Package Manager(NPM) installed first. Then, we need to run the following command:

```javascript
npm install -g expo
```

Now, we need to create a boilerplate react native application using expo. In order to do this, we need to run following command in the desired project directory:

```javascript
expo init \<project\_name\> // project name==\> carParking
```

After running the above command, we will be asked to choose the template for the boilerplate app. Here, we are going to choose the **blank ** template. The blank template provides a very minimal app template as clean as an empty canvas. The selection screenshot is provided below:

![](https://kriss.io/wp-content/uploads/2019/10/Screenshot-2019-10-21-114223-e1571664830965.png)

As we can see, we choose the blank template and hit enter. Then, we need to enter the project name and after that, the boilerplate react native app is configured into our directory.

Now, we need to enter the project directory and then run the command:

```javascript
expo start
```

Then, we will get the following boilerplate app in our emulator screen:

![](https://kriss.io/wp-content/uploads/2019/10/Screenshot_1571637838.png)

As we can see, we have got the starter template running in the emulator. The screen is not configured with too many styles and layout designs. Just a simple white screen with text in the middle.

 

## Configuring **project files and folders**

Now, in the project folder, we need to create a new directory named ‘screens’. In the ‘./screens/’ directory, we need to create a new JavaScript file called Map.js. The overall project folder structure is provided in the screenshot below:

![](https://kriss.io/wp-content/uploads/2019/10/Screenshot-2019-10-21-115936.png)

Now, we need to make the Map.js as a react native screen component. For that, we need to copy the code from the following code snippet and paste in the Map.js file:

```javascript
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class Map extends React.Component {
  render(){
    return (
      <View style={styles.container}>
        <Text>Map</Text>
      </View>
    );
  }
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
```

Here, we have imported the `React` component from the ‘react’ package in order to configure the file as a react file. We have imported some necessary components from the react-native package as well. Then, we have defined a `class` named `Map` which extends to `Component` module of the `React` component. In the `render()` function, we have configured a bare minimal template that has a `View` component wrapping `Text` component. Then, we have defined some styles using the `StyleSheet` component.

Now, we need to import the `Map` component screen into our App.js file. For that, we need to add the following code to our App.js file:

```javascript
import Map from './screens/Map'
```

Now, we need to replace the code inside the `render()` method of App.js file with `Map` component as shown in the code snippet below:

```javascript
render(){
    return (
      <Map />
    );
  }
```

As a result, we will get the same screen as earlier in the emulator.

Here, we can remove styles from the App.js file as well. Now, we are only going to work on the Map.js file for the Map view screen.

 
[Read More...](https://kriss.io/react-native-car-parking-finder-app-ui-clone-1-map-view/)

The post [React Native Car Parking Finder App UI Clone #1 : Map View](https://kriss.io/react-native-car-parking-finder-app-ui-clone-1-map-view/) appeared first on [Kriss](https://kriss.io).

## Disclosure
This post includes affiliate links; I may receive compensation if you purchase
products or services from different links provided in this article.