How can I add a text input in React Native with the click of a button? For example, I would press the "+" button and it would add a text input at the bottom of the View.
here is the code i found in another page but when i click on the plus nothing happen
var textInput = []
let addTextInput = (key) => {
textInput.push(<TextInput key={key} style={{color:'red',borderColor:'red'}}/>);
{ textInput }
}
let orgServiceandWorkHours = (
<View>
<Button title='+' onPress={() =>
addTextInput(textInput.length)} />
{textInput.map((value, index) => {
return value
})}
</View>
)