Comments (9)
Can you please show us your index.ios.js ?
On Tue, Feb 2, 2016 at 12:49 AM Sam [email protected] wrote:
Red screen of death:
[image: screenshot_2_1_16__3_49_pm]
https://cloud.githubusercontent.com/assets/12532733/12735285/61300d56-c8fb-11e5-9479-33b96d4f9b07.png—
Reply to this email directly or view it on GitHub
#18
.
from react-native-simple-router.
Compare to this:
https://github.com/react-native-simple-router-community/react-native-simple-router/blob/master/twitter-example/index.js
note that firstRoute is defined here, as a local variable.
from react-native-simple-router.
import React, {
AppRegistry,
StyleSheet,
Text,
TouchableHighlight,
View
} from 'react-native';
import Router, {Component} from 'react-native-simple-router';
class HelloPage extends Component {
render() {
return <View>
<Text>Hello</Text>
</View>
}
}
let firstRoute = {
name: 'Welcome!',
component: HelloPage
};
class RouterTest extends Component {
render() {
return <Router firstRoute={firstRoute} />
}
}
AppRegistry.registerComponent('RouterTest', () => RouterTest);
from react-native-simple-router.
I don't get it. Isn't my code (besides naming things a little differently) the exact same as the example code in the README?
from react-native-simple-router.
Isn't this the problem? (namely, Component
)
import Router, {Component} from 'react-native-simple-router';
from react-native-simple-router.
Extend your classes from React.Component, not Component.
So for example,
class HelloPage extends React.Component {
from react-native-simple-router.
Ok. I still get the white screen with just "Hello". There's no nav bar. Updated code below:
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
TouchableHighlight,
View
} from 'react-native';
import Router from 'react-native-simple-router';
class HelloPage extends Component {
render() {
return <View>
<Text>Hello</Text>
</View>
}
}
let firstRoute = {
name: 'Welcome!',
component: HelloPage
};
class RouterTest extends Component {
render() {
return <Router firstRoute={firstRoute} />
}
}
AppRegistry.registerComponent('RouterTest', () => RouterTest);
from react-native-simple-router.
Yep, that seems to be the problem.
Will fix the docs accordingly.
Sorry for the inconvenience!
from react-native-simple-router.
Will open a separate issue for the above
from react-native-simple-router.
Related Issues (20)
- Header: Back button text wraps HOT 5
- replaceRoute and resetToRoute No animation? HOT 1
- Twitter example red screen of death HOT 1
- Transition to another route with trans & hideNavigationBar & noStatusBar HOT 1
- multiple customAction in navigation stack
- LeftCorner in firstRoute
- "You are manually calling a React.PropTypes validation function for the..."
- custom navbar? HOT 2
- Trans:true no back button HOT 1
- Unable to fully hide navigation bar HOT 4
- Route management best practicies HOT 1
- Update NPM Version? HOT 2
- Show View after click on rightCorner icon
- make backbutton optional on android
- First Screen RIghtCorner Actions HOT 1
- Customize font for android navbar title HOT 2
- :bug: leftCorner offset titleComponent on Android HOT 1
- RightCorner doesn't work in firstRoute
- Trouble with sceneConfig HOT 2
- not supported by latest version of react-native HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-simple-router.