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

autoGenerateWrapperClass error caused by ReactNavigator in new project #253

Closed
lwansbrough opened this issue Mar 26, 2015 · 6 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@lwansbrough
Copy link
Contributor

Steps to reproduce:

  1. Generate new project with RN CLI
  2. Replace rendered view in index.ios.js with the example in the ReactNavigator docs
  3. Add ReactNavigator to the destructured React object at the top of the file.
  4. Replace MySceneComponent with View
  5. Run the app
@vjeux
Copy link
Contributor

vjeux commented Mar 26, 2015

This error happens when you try to render a component that's actually undefined.

var Component = undefined;
return <Component />;

The error message is terrible, we need to fix it. Cc @balpert

@lwansbrough
Copy link
Contributor Author

So is the expected behaviour or a bug? I can't seem to get a project working with the provided code for ReactNavigator.

@lwansbrough
Copy link
Contributor Author

Ah, found it. The docs are wrong - the component name is Navigator not ReactNavigator.

@tadeuzagallo
Copy link
Contributor

Oh, I'll fix these docs right now!

@lwansbrough
Copy link
Contributor Author

Gracias.

@code-artisan
Copy link

Good job! I get a problem, I don't know how to use NavigatorIOS and Navigator, It's not working...

javascript
'use strict';

var React = require('react-native');
var {
NavigatorIOS,
AppRegistry,
StyleSheet,
ScrollView,
TextInput,
Navigator,
SwitchIOS,
SliderIOS,
DatePickerIOS,
TouchableHighlight,
View,
Text
} = React;

var HelloWorldView = React.createClass({
render: function() {
return (

<Text style={ styles.instructions }> Hello world...

);
}
});

var HomePage = React.createClass({
getInitialState: function () {
return {
input: '',
seleted: false
};
},

render: function() {
return (
<NavigatorIOS initialRoute={{
'title': 'hello index',
'component': HelloWorldView
}}>
);
}
});

var styles = StyleSheet.create({
emptyPage: {
color: 'red'
},
container: {
paddingTop: 30,
paddingLeft: 20,
paddingRight: 20,
backgroundColor: '#FFF'
},
welcome: {
textAlign: 'center',
margin: 10,
},
instructions: {
fontSize: 100,
color: '#000'
},
});

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


![11bf1891-92ed-4710-855f-2e1365fd5090](https://cloud.githubusercontent.com/assets/5195218/6977101/0d8a45d8-d9e9-11e4-905a-83aec25882d3.png)

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 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

No branches or pull requests

5 participants