$ react-native -v
react-native-cli: 0.2.0
react-native: 0.26.1
Build the code below of index.ios.js in xcode
'use strict';
var React = require('react-native');
var styles = React.StyleSheet.create({
text: {
color: 'black',
backgroundColor: 'white',
fontSize: 30,
margin: 80
}
});
class PropertyFinderApp extends React.Component {
render() {
return React.createElement(React.Text, {style: styles.text}, "Hello World!");
}
}
React.AppRegistry.registerComponent('PropertyFinder', function() { return PropertyFinderApp });
Hello World!
Error : Super expression must either be null or a function, not null
This part is the problem: var React = require('react-native');
. Instead write:
var React = require('react');
var ReactNative = require('react-native');
Most helpful comment
This part is the problem:
var React = require('react-native');
. Instead write: