'expo props from inner to outer function component

I am using expo 5.3.0

I have two function components component1 and component2. I am rendering one inside another like this

<component2>
    <component1 />
</component2>

component1 has a Input tag whose value is written at run time by user selecting a date with the DateTimePicker module.

My issue is how to get the value from the Input tag written inside Component1 out to the Component2 file function to be able to submit it with other form values.

I can pass values from component2 to component1 and complete the processing for choosing a date but I want the other way around now. Value from component1(Input value) should be read out to component2 and be available to store and submit.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source