Hey there, here is my React and TypeScript code. I'm wondering why the console.log statement gets called every time my text field changes...
export default function TabOneScreen({
navigation,
}) {
const [out_1, set_out1] = useState('');
const [out_2, set_out2] = useState('');
const [main_device, setMain_dev] = useState('');
console.log("This runs every time the text changes."); // It runs every time the text changes
// Here I have some functions to initialize text input values and I don't want them to run every time
return (
<View style={styles.container}>
<View style={{
}}>
<TextInput
value={out_1}
onChangeText={(username) => set_out1(username)}.
/>