Function not filling whole screen - react-native
Im trying to make an app for the weather in a certain place in the world given by lat and long. The thing is that when I check the screen the applicaction only shows like 1/5 in the center of the screen with the function executed to show the temperature.
Can't upload pictures because of my reputation. But imagine this is the screen: [----|||----] only the ||| portion shows.
I dont know much about react-native so im just searching and doing whatever somebody else do, i have tried forcing a view style "global" for the class but it seems itdoesnt work if you dont put it inside the render, return section which i cant move, atleast to the places i tried.
Didn't include the code inside the functions.
class WeatherScreen extends React.Component {
state = {
isLoading: true,
temperature: 0,
weatherCondition: null,
error: null
};
componentDidMount() {
...
}
fetchWeather(lat, lon) {
fetch(....
}
render() {
const { isLoading, weatherCondition, temperature } = this.state;
return (
<View style={styles.container}>
{isLoading ? (
<View style={styles.loadingContainer}>
<Text style={styles.loadingText}>Fetching The Weather</Text>
</View>
) : (
<Weather weather={weatherCondition} temperature={temperature}/>
)}
</View>
);
}
}
export default WeatherScreen;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Do not apply alignItems and justifyContent to the main screen, it will bring your screen to center. If you want your content in the center then add these properties to children View of main container/View.
Also get screen width and height from react-native dimensions and add them to main container style(height, width).
Try this
import { Dimensions } from 'react-native';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
class YourClass extends Component {
...your code ...
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
height: height,
width: width
},
});
Related
ImageBackground React Native doesn't show itself unless I give it the height even though the image is in the same folder
I am learning React Native and I am having trouble displaying the ImageBackground component. The ImageBackground has source that points to an image in the same folder, despite this is still not visible unless I give the ImageBackground a height in number, because if I try to give it a height in % it still won't show itself. Here is the code for the component execpt the style: import React from 'react'; import { View, ImageBackground, StyleSheet, Text } from 'react-native'; export default function WelcomeScreen(props) { return ( <View> <Text>Welcome</Text> <ImageBackground source={require('./background.jpg')} style={styles.background} /> </View> ); } Trying different ways to style it, the ImageBackground has different behaviors regarding showing itself: This will not show ImageBackground: const styles = StyleSheet.create({ background: { flex: 1, }, }); This won't either: const styles = StyleSheet.create({ background: { flex: 1, height: '100%', }, }); This will show it: const styles = StyleSheet.create({ background: { flex: 1, height: 300, }, }); I do not understand why this happens. From my understanding the size should be added only when the image is from the net, and regardless this, the % value should still work. What am I missing here? EDIT: I made a workaround for this using Dimension and feeding the screen height to the ImageBackground: import { View, ImageBackground, StyleSheet, Dimensions } from 'react-native'; const { height } = Dimensions.get('screen'); const styles = StyleSheet.create({ background: { flex: 1, height, }, }); Though it works, the question why do I need to set a height for an image in the same folder still stand.
if you want to give a value in percentage in such cases you should use some tricks like: background: { height: deviceHeight, }, container: { height: deviceHeight * 50 / 100, } or you can use a popular library in the name of react-native-responsive-screen. This library is going to give you the power to give relative values and convert them to absolute values behind the scene. The snippet below is going to show how to use it: import {widthPercentageToDP, heightPercentageToDP} from 'react-native-responsive-screen'; const styles = StyleSheet.create({ background: { height: heightPercentageToDP('100%'), } }) This should work as you expected ;)
If you want your background image to cover your entire view, try something like this: <View> <ImageBackground style={styles.image} resizeMode={'cover'} source={require('../Images/test.jpg')}> {/*your components*/} </ImageBackground> </View> with this styling: const styles = StyleSheet.create({ image: { height: '100%', width: undefined, } })
swiping on react-native-snap-carousel is not working as expected
I am trying to use react-native-snap-carousel but however, the swiping effect is not working as expected - it is often difficult to swipe left and right, it requires user to swipe harder to move to another picture (as illustrated in the link below). Swiping issue with React Native Snap Carousel I am not able to find any documented soluton but I found one possible prop - swipeThreshold. I try various value, but still the issue persist. Does anyone know the solution to this?
I suggest you to use react-native-image-slider. it's flexible and easy to use. https://www.npmjs.com/package/react-native-image-slider I made a component named slider.js: import React, { Component } from 'react'; import { View, StyleSheet, Image, } from 'react-native'; import ImageSlider from 'react-native-image-slider'; export default class Slider extends Component { render() { return ( <ImageSlider loop autoPlayWithInterval={3000} images={this.props.dataSource} customSlide={({ index, item, style, width }) => ( <View key={index} style={[style, styles.customSlide]}> <Image source={{ uri: item }} style={styles.customImage} /> </View> )} /> ); } } const styles = StyleSheet.create({ customImage: { height: 180, marginRight: 20, marginLeft: 20, borderWidth: 1, borderRadius: 10, marginTop: 8, }, customSlide: { backgroundColor: '#eee', }, }); you can add this to your project and use it wherever you need it like this: import Slider from '../component/slider'; export default class App extends Component { constructor(props) { super(props); this.state = { images: [ 'https://placeimg.com/640/480/nature', 'https://placeimg.com/640/480/tech', 'https://placeimg.com/640/480/animals', 'https://placeimg.com/640/480/tech', ], } render() { return ( <View style={{flex: 1, backgroundColor: '#eee'}}> <Slider dataSource={this.state.images} /> </View> ); } }
React-Native: How to add full screen Lottie animation
I am using linear gradient from lottie, the code is working fine with ios but in android its not fitting to full screen, there is some kind of padding between gradient and the view. On ios its working fine...i tried many ways, buy including padding to 0 and even margin to -20, but nothing worked...any solution? import React, { Component } from 'react'; import { Text, StyleSheet, View, Platform, Dimensions } from 'react-native'; import SignInScreen from './src/screens/auth/SignInScreen'; import Animation from 'lottie-react-native'; import anim from './assets/gradient_animated_background.json'; const height = Dimensions.get('window').height + 20; const width = Dimensions.get('window').width + 20; export default class App extends Component { componentDidMount() { this.animation.play(); } render() { return ( <View style={styles.container}> <Animation ref={animation => { this.animation = animation; }} style={{ backgroundColor: 'red', height: '100%', width: '100%' }} loop={true} source={Platform.OS === 'ios' ? anim : 'gradient_animated_background.json'} /> </View> ); } } const styles = StyleSheet.create({ container: { backgroundColor: 'blue', flex: 1, }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, color: '#ffffff' } }); The animation, and when ever i keep changing the width and height..it forcefully tries to maintain the aspect radio...(not sure though) {"v":"4.6.10","fr":15,"ip":0,"op":155,"w":1080,"h":1920,"nm":"background","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[540,960,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[1160,880]},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect"},{"ty":"st","c":{"a":0,"k":[0.9960784,0.7843137,0.145098,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":6},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"gf","o":{"a":0,"k":100},"r":1,"g":{"p":3,"k":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[0,0.511,0.89,0.283,0.5,0.334,0.873,0.583,1,0.156,0.857,0.882],"e":[0,0.726,0.283,0.89,0.5,0.441,0.356,0.886,1,0.156,0.429,0.882]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":31,"s":[0,0.726,0.283,0.89,0.5,0.441,0.356,0.886,1,0.156,0.429,0.882],"e":[0,0.89,0.283,0.283,0.5,0.886,0.553,0.219,1,0.882,0.823,0.156]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":61,"s":[0,0.89,0.283,0.283,0.5,0.886,0.553,0.219,1,0.882,0.823,0.156],"e":[0,0,0.312,0.737,0.5,0.078,0.597,0.754,1,0.156,0.882,0.771]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":91,"s":[0,0,0.312,0.737,0.5,0.078,0.597,0.754,1,0.156,0.882,0.771],"e":[0,0.51,0.89,0.282,0.5,0.333,0.873,0.582,1,0.157,0.855,0.882]},{"t":120}]}},"s":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[-430.769,-404.573],"e":[23.726,-364.48],"to":[75.7491683959961,6.68213844299316],"ti":[-123.915840148926,-8.51547145843506]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":31,"s":[23.726,-364.48],"e":[312.726,-353.48],"to":[123.915840148926,8.51547145843506],"ti":[-1.00208830833435,-1.83333337306976]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":61,"s":[312.726,-353.48],"e":[29.739,-353.48],"to":[1.00208830833435,1.83333337306976],"ti":[120.055290222168,0.60746711492538]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":91,"s":[29.739,-353.48],"e":[-407.606,-357.125],"to":[-120.055290222168,-0.60746711492538],"ti":[72.8907089233398,0.60746711492538]},{"t":120}]},"e":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[374.412,342.611],"e":[22.822,357.191],"to":[-58.5984153747559,2.42986845970154],"ti":[132.520950317383,-7.89707231521606]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":31,"s":[22.822,357.191],"e":[-420.714,389.994],"to":[-132.520950317383,7.89707231521606],"ti":[-4.68509674072266,-7.89707231521606]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":61,"s":[-420.714,389.994],"e":[50.932,404.573],"to":[4.68509674072266,7.89707231521606],"ti":[-132.918350219727,4.25226974487305]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":91,"s":[50.932,404.573],"e":[376.797,364.48],"to":[132.918350219727,-4.25226974487305],"ti":[-54.3107261657715,6.68213844299316]},{"t":120}]},"t":1,"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill"},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[93.29,219.491],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":155,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":1,"nm":"Deep Red Solid 1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[540,960,0]},"a":{"a":0,"k":[540,960,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"sw":1080,"sh":1920,"sc":"#be2a2a","ip":0,"op":155,"st":0,"bm":0,"sr":1}]}
What you are missing is the resizeMode, which is not specified on the documentation page, but if you look at the source you'll find it. Here's something that works if you don't care to lose a few pixels: import React, { Component } from 'react'; import { StyleSheet, View, Dimensions } from 'react-native'; import LottieView from 'lottie-react-native'; import { anim } from './assets/animation.json'; const { height, width } = Dimensions.get('window') export default class App extends Component { componentDidMount() { this.animation.play(); } render() { return ( <View style={styles.container}> <LottieView ref={animation => { this.animation = animation; }} style={{ width: width + 10, height: height, marginLeft: - 5 }} resizeMode='cover' loop={true} source={anim} /> </View> ); } } const styles = StyleSheet.create({ container: { backgroundColor: 'blue', flex: 1, }, }); Notice that I've exported the asset a bit differently since I tried this on https://snack.expo.io and for some reason they don't like JSON files 😁, so now the assets look something /assets/animation.json.js export const anim = {"v":"4.6.10","fr":15,"ip":0,"op":155,"w":1080,"h":1920,"nm":"background","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[540,960,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[1160,880]},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect"},{"ty":"st","c":{"a":0,"k":[0.9960784,0.7843137,0.145098,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":6},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"gf","o":{"a":0,"k":100},"r":1,"g":{"p":3,"k":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[0,0.511,0.89,0.283,0.5,0.334,0.873,0.583,1,0.156,0.857,0.882],"e":[0,0.726,0.283,0.89,0.5,0.441,0.356,0.886,1,0.156,0.429,0.882]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":31,"s":[0,0.726,0.283,0.89,0.5,0.441,0.356,0.886,1,0.156,0.429,0.882],"e":[0,0.89,0.283,0.283,0.5,0.886,0.553,0.219,1,0.882,0.823,0.156]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":61,"s":[0,0.89,0.283,0.283,0.5,0.886,0.553,0.219,1,0.882,0.823,0.156],"e":[0,0,0.312,0.737,0.5,0.078,0.597,0.754,1,0.156,0.882,0.771]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":91,"s":[0,0,0.312,0.737,0.5,0.078,0.597,0.754,1,0.156,0.882,0.771],"e":[0,0.51,0.89,0.282,0.5,0.333,0.873,0.582,1,0.157,0.855,0.882]},{"t":120}]}},"s":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[-430.769,-404.573],"e":[23.726,-364.48],"to":[75.7491683959961,6.68213844299316],"ti":[-123.915840148926,-8.51547145843506]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":31,"s":[23.726,-364.48],"e":[312.726,-353.48],"to":[123.915840148926,8.51547145843506],"ti":[-1.00208830833435,-1.83333337306976]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":61,"s":[312.726,-353.48],"e":[29.739,-353.48],"to":[1.00208830833435,1.83333337306976],"ti":[120.055290222168,0.60746711492538]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":91,"s":[29.739,-353.48],"e":[-407.606,-357.125],"to":[-120.055290222168,-0.60746711492538],"ti":[72.8907089233398,0.60746711492538]},{"t":120}]},"e":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[374.412,342.611],"e":[22.822,357.191],"to":[-58.5984153747559,2.42986845970154],"ti":[132.520950317383,-7.89707231521606]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":31,"s":[22.822,357.191],"e":[-420.714,389.994],"to":[-132.520950317383,7.89707231521606],"ti":[-4.68509674072266,-7.89707231521606]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":61,"s":[-420.714,389.994],"e":[50.932,404.573],"to":[4.68509674072266,7.89707231521606],"ti":[-132.918350219727,4.25226974487305]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":91,"s":[50.932,404.573],"e":[376.797,364.48],"to":[132.918350219727,-4.25226974487305],"ti":[-54.3107261657715,6.68213844299316]},{"t":120}]},"t":1,"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill"},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[93.29,219.491],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":155,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":1,"nm":"Deep Red Solid 1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[540,960,0]},"a":{"a":0,"k":[540,960,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"sw":1080,"sh":1920,"sc":"#be2a2a","ip":0,"op":155,"st":0,"bm":0,"sr":1}]}
So the first answer raised an important point (adding resizeMode="cover"). But that's not enough, If you test across several screens sizes, you might still find unwanted margins and spaces. I had this issue too, Here's the simple solution: Get the dimensions of the lottie file (e.g 300 X 600) Set width only, then use aspectRatio to determine the height. (must) Set flexGrow = 1 (must) e.g <LottieView style={{ width: 300, aspectRatio: 300 / 600, flexGrow: 1, alignSelf: 'center', }} resizeMode="cover" ref={animation=> { this.animation = animation; }} source={require ('./assets/animation.json')} autoPlay={false} loop={false} /> I guess the problem arises because you cant use width and height at the same time in the styling of the Lottie view. So an easy workaround is to use the width and aspectRatio Good luck!
Overlay view on top of list view?
I have an app with a full screen list view. I'd like to add a new view hierarchy on top (it would partially block the list view and float above). Sort of like Tweetbot, it will serve as a drop down message box that layers over the list view. I can't figure out the right render code to achieve this. I was able to set position to absolute on both ListView and the floating view to layer them, but can't figure out how to expand the ListView to full screen (flex: 1) and have the floating box on top.
So I think I figured this out after composing a simple example for this post. The following works to float one view over another: 'use strict'; var React = require('react-native'); var { AppRegistry, StyleSheet, View, } = React; var styles = StyleSheet.create({ fullScreen: { flex:1, backgroundColor: 'red', }, floatView: { position: 'absolute', width: 100, height: 100, top: 200, left: 40, backgroundColor: 'green', }, parent: { flex: 1, } }); var Example = React.createClass({ render: function() { return ( <View style={styles.parent}> <View style={styles.fullScreen}/> <View style={styles.floatView}/>{/* WORKS FOR REGULAR VIEW */} </View> ); }, }); module.exports = Example; What I was trying to do was float another custom class, so I replaced the render code w/ the following: var Example = React.createClass({ render: function() { return ( <View style={styles.parent}> <View style={styles.fullScreen}/> <DropDown style={styles.floatView}/>{/* DOES NOT WORK FOR CUSTOM VIEW */} </View> ); }, }); That did not work. By the way, my "DropDown" just returns a View with some Text in it. But doing the following does work: var Example = React.createClass({ render: function() { return ( <View style={styles.parent}> <View style={styles.fullScreen}/> <View style={styles.floatView}>{/* WORKS FOR CUSTOM VIEW */} <DropDown /> </View> </View> ); }, });
Odd react-native issue with rendering
I'm currently trying to learn react-native and running into a problem after a tutorial. I followed the PropertyFinder tutorial on Ray Wenderlich's site, which went fine. Breaking away now to start something on my own, I can't seem to get a page to render - and I keep running into the same exception which may be causing the page not to render (but I'm not entirely sure). Here is the main app page, which is simply the navigator: 'use strict'; var React = require('react-native'); var WelcomePage = require('./WelcomePage'); var { AppRegistry, StyleSheet, Text, View, } = React; var MyApp = React.createClass({ render: function() { return ( <React.NavigatorIOS style={styles.container} initialRoute={{ title: 'Welcome', component: WelcomePage }}/> ); } }); var styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', } }); AppRegistry.registerComponent('MyApp', () => MyApp); And here's the welcome page: 'use strict'; var React = require('react-native'); var { StyleSheet, Text, View, Component } = React; var styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF' }, textTitle: { color: 'black', fontSize: 35, textAlign: 'center' }, textSubs: { color: 'black', fontSize: 25, textAlign: 'center' } }); class WelcomePage extends Component { render() { console.log('About to render welcome page'); return ( <View style={styles.container}> <Text style={styles.textTitle}> Welcome to MyApp! </Text> <Text style={styles.textSubs}> Good Choice for an App </Text> <Text style={styles.textSubs}> Going to start with setting up the App </Text> <Text style={styles.textSubs}> Are you ready? </Text> </View> ); } } module.exports = WelcomePage; Now, the console logging comes out correctly with 'About to render welcome page', however the result I get is just a blank white window. If I use the chrome debugger, I do get an exception if a chose to Pause on Exceptions. The code snippet it pauses on is this: /** * Given a constructor can we call it without `new`? * * #param {function} Collection */ function isCallableWithoutNew(Collection) { try { Collection(); // <<<--- Here's where the exception seems to happen } catch (e) { return false; } return true; } If I go back to the tutorial project, it works just fine. The only difference I can see is that when I initialized the tutorial project, the Animation library I pulled in did not have an 'Experimental' version (RCTAnimation), but with the new project I tried to start above, I have to use the Experimental version if I want it to work. Really though, I only tested that early on and am not pulling it in any longer (I don't need it yet). I've also tried playing around a bit with the styles, but get the same result - and the same exception occurring. Exception stack chrome shows is: "TypeError: Constructor Map requires 'new' at Map (native) at isCallableWithoutNew (http://localhost:8081/index.ios.bundle:15407:5) at shouldPolyfillES6Collection (http://localhost:8081/index.ios.bundle:15378:5) at http://localhost:8081/index.ios.bundle:14500:8 at http://localhost:8081/index.ios.bundle:15095:3 at require (http://localhost:8081/index.ios.bundle:245:25) at http://localhost:8081/index.ios.bundle:14288:11 at require (http://localhost:8081/index.ios.bundle:245:25) at http://localhost:8081/index.ios.bundle:14131:11 at require (http://localhost:8081/index.ios.bundle:245:25)" I want to say that looks like an API version issue or something? Am I missing something obvious here? Thanks for any help.
So this ended up being my styles on the 'index.ios.js' page. I changed this: var styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', } }); To this: var styles = StyleSheet.create({ container: { flex: 1 } }); And the view then rendered. I guess I need to spend some time on figuring out how these styles layout components... If anyone knows why the main NavigatorIOS pane would push content too far off to the right to be visible (which is what was happening) if the styles were set as they were originally, please let me know. The culprits were: 'justifyContent' 'alignItems' 'backgroundColor' of course had no affect on the view rendering (I didn't add it back in but could without issue).