1 of 59

React Native

Overview

Bonnie Eisenman

hack.summit() 2016

2 of 59

Hi, I'm Bonnie.

3 of 59

So what is React Native?

4 of 59

Using JavaScript to write truly native, cross-platform apps for iOS & Android.

5 of 59

This is exciting.

6 of 59

7 of 59

React is a JavaScript library

for building user interfaces.

8 of 59

9 of 59

10 of 59

11 of 59

Your tools should solve real problems.

12 of 59

Why React?

  • It's fast
  • Components are a natural way to think about building user interfaces
    • Fast, declarative, composable, modular.
  • Puts the focus back on the view

13 of 59

14 of 59

Components

var HelloMessage = React.createClass({

render: function() {

return <div>Hello {this.props.name}</div>;

}

});

...

<HelloMessage name="Bonnie"/>

15 of 59

State Change

Compute Diff

Re-render

Virtual DOM

Browser DOM

16 of 59

Wait, why render to the DOM at all?

17 of 59

18 of 59

State Change

Compute Diff

Re-render

Virtual DOM

Host platform's rendering API

19 of 59

Describe your UI with React,

& React renders it for you.

20 of 59

React Native is

actually native.

21 of 59

React vs React Native

is just

web vs mobile

22 of 59

Browser DOM versus mobile

  • <div>
  • <img>
  • <span>, <p>
  • <ul>, <ol>
  • <View>
  • <Image>
  • <Text>
  • <ListView>

23 of 59

You're invoking real APIs!

24 of 59

Using React Native

25 of 59

<DatePickerIOS

date={this.state.date}

mode="date"

/>

26 of 59

27 of 59

28 of 59

CSS on mobile?!

29 of 59

30 of 59

31 of 59

(no but like actually)

32 of 59

container: {

flex: 1,

alignItems: 'center',

paddingTop: 30

}

33 of 59

34 of 59

35 of 59

36 of 59

Developer Setup

37 of 59

It's just normal mobile dev, with JavaScript.

38 of 59

39 of 59

40 of 59

41 of 59

42 of 59

43 of 59

Over-the-air updates!

44 of 59

45 of 59

Working with React Native

  • Mostly, just like React for Web
  • Standardized styling API
  • Native performance & look-and-feel
  • Native API access
  • Faster development process

46 of 59

So what's it mean?

47 of 59

Mobile is hard.

48 of 59

Developer experience matters.

49 of 59

Your tools should solve real problems.

50 of 59

React Native Advantages

  • No more silos
  • Code sharing without compromising on quality
  • Shorter feedback cycle
  • More tools
  • Native development, when you need it

51 of 59

52 of 59

So what's the catch?

53 of 59

54 of 59

JavaScript

55 of 59

This is the real deal.

56 of 59

Developer experience matters.

57 of 59

What's Next?

  • More platforms?
  • More solutions to common problems
    • Better gesture handling
    • Stronger animations
    • Over-the-air updates
  • Tool simplification?
  • ???

58 of 59

59 of 59

Questions?

  • Talk to me! I'm @brindelle.
  • Buy my book! 40% off with code AUTHD at bit.ly/learningreactnative
  • Thanks!