catalinmiron / react-native-dribbble-app

Dribbble app built with React Native
MIT License
2.07k stars 407 forks source link

Hi can you pls explain this code to me pls?thx! #8

Closed zzz6519003 closed 9 years ago

zzz6519003 commented 9 years ago
var {
  Image,
  PixelRatio,
  ScrollView,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
  Component
} = React;

what does it do?

catalinmiron commented 9 years ago

Hi @zzz6519003 ,

These are React Native Components. You can check Facebook's React Native docs for further informations.

zzz6519003 commented 9 years ago

so basically it's gonna import just these things Image, PixelRatio, ScrollView, StyleSheet, Text, TouchableOpacity, View, Component

into the thing called react?

catalinmiron commented 9 years ago

into the thing called react?

No, you import the components from React

lwansbrough commented 9 years ago

@zzz6519003 This is called object destructuring. It's basically saying, "pull out the following properties from this object, each as their own variable."

zzz6519003 commented 9 years ago

Hey man, here's your beer! :beer: catch!

catalinmiron commented 9 years ago

@lwansbrough :+1: you have a :cookie: