Search code examples
iosreactjsreact-nativexcode8

Unexpected character "" while using react native in iOS


I am in the learning stage for using ReactNative in iOS. So currently i have done all the initial set ups for it and now i am following the tutorial for basic learning. React Native

But i am getting the following error.

enter image description here

The associated .js file code is here

// src/ReactCalculator.js

import React, { Component } from 'react';
import {
    Text,
    AppRegistry
} from 'react-native';

class ReactCalculator extends Component {

    render() {
        return (
            <Text>Hello, React!</Text>
        )
    }

}

AppRegistry.registerComponent(‘reactTutorialApp’, () => ReactCalculator);

Please help me with the situation.


Solution

  • AppRegistry.registerComponent(‘reactTutorialApp’, () => ReactCalculator);
    

    should be

    AppRegistry.registerComponent('reactTutorialApp', () => ReactCalculator);
    

    Please note the and . These are special characters.