Skip to content

Error running example apps on fresh install of react native 0.25.1 on iOS #8654

Description

@rodenp

I have a fresh new install of react native on ios version 0.25.1.
When i try and build and run the awesome app, or any other for that matter i get a red screen with the following text.

Seems you're trying to access 'ReactNative.Component' from the 'react-native' package. Perhaps you meant to access 'React.Component' from the 'react' package instead?

For example, instead of:
import React, { Component, View } from 'react-native';

You should now do:

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

As you can see in the sample code below, everything looks ok to me:

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

class Project extends Component {
render() {
return (


Welcome to React Native!


To get started, edit index.ios.js


Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu


);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});

AppRegistry.registerComponent('Project', () => Project);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions