Skip to content

Instantly share code, notes, and snippets.

@misostack
Last active March 28, 2024 02:44
Show Gist options
  • Save misostack/dd505ec1bace932ff51697f3d4b639f1 to your computer and use it in GitHub Desktop.
Save misostack/dd505ec1bace932ff51697f3d4b639f1 to your computer and use it in GitHub Desktop.
React Native Tutorial 2024

React Native Tutorial 2024

Day01 - 2024

What is React Native?

image

Technical View

Views

JSX Components are compiled to Native Views, not the javascript logic code.

image

Components are compiled

image

image

What about JS Logic Code?

image

Expo CLI vs React Native CLI

image

Conclusion:

  • You can start with expo cli because of easy working flow and less setup
  • With expo, you can test with native functions like camera with devices more easier.
  • You can always switch from expo cli to react native cli just by using "eject"
  • With React Native CLI setup, you can mix between js code and platform native code, such as: kotline or swift
  • React Natve CLI required more setup

First project with expo

Project: TodoList

Getting start

npm i -g expo-cli

Create new

## list template
npx create-expo-app --template
## create new
npx create-expo-app rn-example

Final project with expo

Build a check-in app for your self, display list of check-in from new to old. When you check-in, you must take a photo, your photo will be saved with your current location.

@misostack
Copy link
Author

React Native Roadmap 2024

image

@misostack
Copy link
Author

misostack commented Mar 26, 2024

Day002 - Creating UI with React Native Core Components

image

Creating Layouts with FlexBox Concept

Main Axis: justifyContent, flex:1( as much space as possible along the main axis)

Cross Axis: alignItems:'stretch' (default)

@misostack
Copy link
Author

misostack commented Mar 26, 2024

image

@misostack
Copy link
Author

image

@misostack
Copy link
Author

image

@misostack
Copy link
Author

misostack commented Mar 26, 2024

Default FlexBox
image

image

@misostack
Copy link
Author

  • There is no style for Button Component
  • Text Element on IOS doesn't support some kind of style

This is not working on IOS

image

We'll use another way

image

@misostack
Copy link
Author

There is no cascade-css in ReactNative, no inheritance styles.

@misostack
Copy link
Author

By default the app container does not support scroll. You must enable it explicitly

@misostack
Copy link
Author

ScrollView renders all at the beginning even it doesn't visible to the users
So we have another solution for our dynamic list is built-in component that ship with React Native Component => FlatList

@misostack
Copy link
Author

image

@misostack
Copy link
Author

image

@misostack
Copy link
Author

image

@misostack
Copy link
Author

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment