import React, { Component } from 'react'
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity
} from 'react-native'
class Child extends Component{
state = {
val:10
}
render(){
this.childFun = function(num){
this.setState({val:this.state.val+num})
}
let {val} = this.state
return(
class App extends Component {
render() {
this.parentFun = ()=>{
this.refs.mark.childFun(10)
}
return (
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, })
AppRegistry.registerComponent('App', () => App)