Fireship · @fireship

React Native in 100 Seconds

Uploaded September 28, 2021 · Length 2:17

React Native in 100 Seconds

Summary

react native explained in 100 seconds, building ios android and web apps with js and react

  • react native
  • cross platform development
  • mobile app development
  • javascript
  • react

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    react native write javascript and react

  2. 0:02

    to build apps for ios android and the

  3. 0:05

    web from a single codebase according to

  4. 0:07

    atwood's law any application that can be

  5. 0:09

    written in javascript will eventually be

  6. 0:11

    written in javascript the first way js

  7. 0:13

    developers tried to build mobile apps

  8. 0:15

    was by wrapping their native

  9. 0:16

    applications in a sandbox browser called

  10. 0:18

    a webview using tools like apache

  11. 0:20

    cordova and adobe phonegap the

  12. 0:22

    philosophy is right once run anywhere

  13. 0:25

    this works but it can be hard to make a

  14. 0:26

    website feel like a true native

  15. 0:28

    experience react native takes a

  16. 0:30

    different approach it feels just like

  17. 0:32

    react dom for the web but instead of

  18. 0:34

    using html and the dom as building

  19. 0:36

    blocks for the ui it uses the native

  20. 0:38

    components that you would find on ios

  21. 0:40

    and android the philosophy is learn once

  22. 0:43

    right anywhere you can't just take your

  23. 0:44

    existing react web app and upload it to

  24. 0:46

    the app store but you can use the react

  25. 0:48

    skills you already have to build a

  26. 0:50

    native app without ever having to touch

  27. 0:52

    java or objective c instead you import

  28. 0:54

    building block components like button

  29. 0:56

    switch scroll view and the most

  30. 0:58

    fundamental of which is view at runtime

  31. 1:01

    it will use the true native component on

  32. 1:03

    the corresponding platform like uiview

  33. 1:05

    android.view or div on the web it's like

  34. 1:08

    building three apps for the price of one

  35. 1:10

    but in some cases you may want a

  36. 1:12

    different visual experience based on the

  37. 1:13

    underlying os the platform module allows

  38. 1:16

    you to check which platform you're on

  39. 1:18

    and render different components

  40. 1:19

    accordingly when it comes to visuals

  41. 1:21

    there's no css in react native instead

  42. 1:23

    every core component takes a style prop

  43. 1:26

    that can be customized with a style

  44. 1:27

    sheet constructed from javascript in

  45. 1:29

    development it supports fast refresh

  46. 1:32

    which means you can instantly see the

  47. 1:33

    changes you make to your code on any

  48. 1:35

    platform you may also want to tap into

  49. 1:37

    native features like the device camera

  50. 1:39

    push notifications and geolocation these

  51. 1:41

    concerns are handled by one of the most

  52. 1:43

    active open source communities on github

  53. 1:45

    there's open source packages for almost

  54. 1:47

    everything that can be installed with

  55. 1:48

    npm just like any other javascript

  56. 1:50

    project and there's frameworks like expo

  57. 1:52

    that build on top of react native

  58. 1:54

    primitives to provide all the tooling

  59. 1:55

    required to ship your app to production

  60. 1:57

    you can use react native to build a

  61. 1:59

    complete mobile app or integrate it with