in the native response example:
https://github.com/facebook/react-native
var React = require('react-native');
var { ScrollView, TouchableHighlight, Text } = React;
var TouchDemo = React.createClass({
render: function() {
return (
<ScrollView>
<TouchableHighlight onPress={() => console.log('pressed')}>
<Text>Proper Touch Handling</Text>
</TouchableHighlight>
</ScrollView>
);
},
});
what does this syntax mean?
var { ScrollView, TouchableHighlight, Text } = React;
I typed it in the nodejs command, causing a syntax error. Is this special Javascripts syntax only for React Native?
thank
source
share