React Native 101

Deep introduction

 

 

stanislav.miklik@instea.sk
http://instea.sk

Agenda

  • Intro
  • Fundamentals
  • Under the hood
  • Development tools
  • Conclusion

Why?

Mobile App development is expensive
  • Develop twice
  • Test twice
  • Maintain twice
  • Not reusable business logic
  • Lengthy deployment

Why?

For one product 3 different languages = teams
  • Java - Android
  • Objective-C / Swift - iOS
  • Javascript - Web

Solution to our problems

REACT NATIVE

  • "One language to rule them all"
  • Utilizing native components
  • 95% components same on both platforms
  • Logic shared on all platforms

React

  • Declarative
  • Component-Based
  • Learn Once, Write Anywhere

Declarative

Virtual DOM

Component

Learn Once, Write Anywhere

  • Web
  • Server Side
  • Mobile
  • Virtual Reality

React Native

Inline styles

Other "web standards"

  • Flexbox
  • XMLHttpRequest, Fetch API
  • WebSockets
  • Geolocation API
  • setTimeout etc.

Native UI components

  • View
  • Text
  • Image
  • ScrollView etc.

Platform look&feel

Picker, RefreshControl, Switch, Slider, TextInput etc.

API

JS access to underlying features like app storage, clipboard, linking etc.

Platform specific API like DatePickerAndroid, ActionSheetIOS etc.

Native Modules

Under the hood

from React Native: Under the hood slides

Async Bridge

  • JS thread does not block UI thread
  • UI diff is sent in a batch
  • Translates to Apple UIKit / Android SDK views (no webview)
  • Declarative animations

Development tools

  • Hot reload
  • Debugging JS in Chrome
  • In-app inspector
  • CodePush by MS
  • Expo Snack
  • Redux dev tools, ...
Demo

Other platforms

Not so good

  • Moving fast
  • Variable quality of 3rd party
  • Documentation coverage
  • Not for action games development
  • Slower app startup

Good

  • Moving fast
  • Active community
  • Native speed & experience
  • Code reuse
  • React & JS
  • Developer Experience
  • Easy to start with

Questions?

 

 

stanislav.miklik@instea.sk
@StanislavMiklik

http://instea.sk
https://github.com/instea

More information

https://facebook.github.io/react/

http://facebook.github.io/react-native/

http://www.reactnative.com/uiexplorer/

Testing: https://github.com/facebook/jest

https://expo.io/

https://js.coach/react-native

 

Images from https://pixabay.com

Declarative animations

  • Composition (sequence, ...)
  • Interpolation
  • Native Driver