Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rodenp opened this issue Jul 8, 2016 · 2 comments · May be fixed by hixio-mh/react-native#30
Closed

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

rodenp opened this issue Jul 8, 2016 · 2 comments · May be fixed by hixio-mh/react-native#30
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@rodenp
Copy link

rodenp commented Jul 8, 2016

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);

@tahmidmozaffar
Copy link

Hello, I am facing same problem. Did you solve this?

@lacker
Copy link
Contributor

lacker commented Nov 30, 2016

As far as I can tell this is no longer an issue.

@lacker lacker closed this as completed Nov 30, 2016
@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants