Pass data from child to components in react native

 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.js
import 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