Skip to content

Instantly share code, notes, and snippets.

@togakangaroo
Created August 16, 2016 18:43
Show Gist options
  • Save togakangaroo/9b5cb370a6808a8d093e214cb63f8f0e to your computer and use it in GitHub Desktop.
Save togakangaroo/9b5cb370a6808a8d093e214cb63f8f0e to your computer and use it in GitHub Desktop.
nojsx
import React, { Component, createFactory } from 'react'
import { AppRegistry, StyleSheet, Text, View } from 'react-native'
const view = createFactory(View)
const text = createFactory(Text)
const styles = {
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
}
const ReactNativeWeb = () =>
view({style: styles.container},
text({style:styles.welcome}, "Welcome to React Native Tester"),
text({style:styles.instructions}, "initial code is in index.web.js")
)
AppRegistry.registerComponent('ReactNativeWeb', () => ReactNativeWeb)
AppRegistry.runApplication('ReactNativeWeb', { rootTag: document.getElementById('react-app') })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment