React Native Tutorial: Building Apps with JavaScript

Great stuff, and it all works!
(with minor changes for react-native 0.27.0-rc2)

As people already suggested namespaces have changed for ‘react’ and ‘react-native’. I like Tom’s approach require(‘…’) so my fix in index.ios.js is like this:

‘use strict’;
var React = require(‘react’);
var ReactNative = require(‘react-native’);

You’ll need to figure out after that which components is in which namespace. However the following destructive syntax taken from my modified SearchResult.js can help:

‘use strict’;
var React = require(‘react’);
var {
Component
} = React;

var ReactNative = require(‘react-native’);
var {
StyleSheet,
Text,
View,
TouchableHighlight,
Image,
ListView
} = ReactNative;

And lastly the guid property is no longer supported by the Nestoria api (or at least i didn’t see it :slight_smile:) , but you can use thumb_url for the uniqueness purpose. So you’ll need to replace ALL occurrences of guid with thumb_url in SearchResults.js, e.g. replace:

var property = this.props.listings.filter(prop => prop.guid === guid)[0];

with:

var property = this.props.listings.filter(prop => prop.thumb_url === thumbUrl)[0];

Thank you for the great tutorial!
Tom, great references as well, which is extremely useful!!

1 Like