import React, { useState, useEffect } from 'react'; import { View, Text, Button, TextInput } from 'react-native'; import { useTailwind } from 'tailwind-rn'; import AsyncStorage from '@react-native-async-storage/async-storage'; function SettingsScreen({ navigation }) { const tailwind = useTailwind(); const [apiEndpoint, setApiEndpoint] = useState(''); useEffect(() => { const getAPI = async () => { const api = await AsyncStorage.getItem('apiEndpoint'); setApiEndpoint(api || ''); console.log(api) }; getAPI(); }, []); const handleLogout = async () => { await AsyncStorage.removeItem('token'); await AsyncStorage.removeItem('userID'); navigation.navigate('Login'); }; const handleSave = async () => { await AsyncStorage.setItem('apiEndpoint', apiEndpoint); }; return ( Settings setApiEndpoint(text)} placeholder="API endpoint" />