Child
My.js
import React from "react";
import { View, TextInput,} from 'react-native';
import { Styles } from "./Styles/Styles";
const My = (props) => {
const changeItemName = (val) => {
props.ItemNameChange(val);
}
return (
<View>
<TextInput
style={
[
Styles('').MyTxtInput,
{ width: 180 }
]
}
onChangeText={changeItemName}></TextInput>
</View>
);
}
export default My
App.jsimport React from "react";
import My from "./components/Price";
function App(){
const getData=(Data)=>{
console.log(Data);
}
return (<My IteamNameChange={getData}></My>);
}
export default App
Comments
Post a Comment
If you any doubt of any topic then you can comment me.