npm install react-native-maps --save
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { createBottomTabNavigator,createDrawerNavigator } from 'react-navigation'; | |
import { NavigationActions } from 'react-navigation'; | |
class HomeScreen extends React.Component { | |
render() { | |
return ( | |
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> |
import React, { Component } from 'react' | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
} from 'react-native' | |
class App extends Component { | |
render() { |
<script> | |
document.addEventListener("message", function (event) { | |
let parsed = JSON.parse(event.data); | |
if (parsed.type === "photo") { | |
setPhoto(parsed.params); | |
} | |
if (parsed.type === "location") { | |
setLocation(parsed.params); | |
} | |
}); |
static getDerivedStateFromProps(nextProps, prevState) { | |
if (nextProps.carListReducer.list.length === 0 && !nextProps.carListReducer.error) { | |
return { | |
var newState = Object.assign({}, prevState); | |
delete newState.showSpinner; | |
return newState; | |
}; | |
} | |
else { | |
return { |
import React, { Component } from 'react'; | |
import { | |
Text, | |
View, | |
StyleSheet, | |
ScrollView, | |
TouchableOpacity, | |
} from 'react-native'; | |
class Carousel extends Component { |
func convertToTL(price:String) -> String { | |
let count = price.count; | |
if (count <= 2){ | |
return "0.\(price) TL" | |
} | |
else { | |
let suffix = price.suffix(2) | |
let prefix = price.prefix(count - 2) |
export class RadioButton extends Component { | |
state = { | |
selectedIndex: -1 | |
}; | |
onSelected(index) { | |
this.setState({ selectedIndex: index }); | |
let selectedValue = this.props.radioValues[index]; | |
this.props.input.onChange(selectedValue); | |
} | |
render() { |