Posts

Showing posts with the label Jsx

Atom.io: Emmet And Jsx

Answer : Open Atom -> Preferences -> Packages -> Emmet Scroll down a bit and you'll see a note about this particular issue. From there you just need to grab the correct context, which in my case was source js jsx and add it to your Keymap configuration. # Auto expanding for emmet @ 'atom-text-editor[data-grammar="source js jsx"]': 'tab': 'emmet:expand-abbreviation-with-tab' OR (with a more relaxed selector) # Auto expanding for emmet @ 'atom-text-editor[data-grammar*="js"].not:[mini]': 'tab': 'emmet:expand-abbreviation-with-tab' As of the latest version you can hit cmd + shift + e. I assume for windows or linux it would be ctrl + shift + e (Although I have not verified windows and linux one)

Center Image React Native Loading Screen

Answer : You need to set the style of <View> for justifyContent and alignItems for centering the `. Should be like this : const LoadingScreen = () => ( <View style={styles.container}> <Image style={styles.logo} source={logo} /> </View> ); const styles = StyleSheet.create({ container: { justifyContent: 'center', alignItems: 'center', }, logo: { width: 300, height: 400, }, }); Or you can use alignSelf on the <Image> to make it center, but it will still need to add justifyContent on <View> to make it center vertically. The View container should have styling as flexDirection: 'column' justifyContent: 'center' alignItems: 'center' height: '100%' The height makes sure it spans throughout the page, thus making the image become both vertically and horizontally aligned. For the image size, I think using percentage will do the trick instead ...