Alexey Vasiliev, Railsware
Brought to you by Alexey Vasiliev, Railsware
import React from 'react';
import {Text, View} from 'react-native';
class RubyMeditationMobile extends React.Component {
render() {
return (
<View>
<Text>Hello Rubymeditation!</Text>
</View>
);
}
}
import {AppRegistry} from 'react-native';
AppRegistry.registerComponent(
'RubyMeditationMobile',
() => RubyMeditationMobile
);
$ react-native start // start dev server
$ react-native run-ios // run app in ios emulator
$ react-native run-android // run app in android emulator
import {StyleSheet} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
hello: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});
export default class RubyMeditationMobile extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.hello}>Hello RubyMeditation!</Text>
</View>
);
}
}
fetch('https://mywebsite.com/endpoint/', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
firstParam: 'yourValue',
secondParam: 'yourOtherValue',
})
})